Skip to content

Instantly share code, notes, and snippets.

View bbatha's full-sized avatar
🏠
Working from home

Ben Batha bbatha

🏠
Working from home
View GitHub Profile
@bbatha
bbatha / playground.rs
Created October 23, 2015 18:40 — forked from anonymous/playground.rs
Shared via Rust Playground
#[derive(Debug)]
struct Foo(u32);
fn foo(val: u32) -> Foo { Foo(val) }
impl Foo {
fn new() -> Self { Foo(3) }
}
trait BoolExt {
use std::collections::HashSet;
use std::hash::Hash;
pub struct Dag<'a, L: 'a, N: 'a> {
leaves: HashSet<L>,
// Might be better as an arena but that isn't available the playpen
nodes: Vec<Node<'a, L, N>>
}
impl<'a, L: 'a + Eq + Hash, N: 'a> Dag<'a, L, N> {
# change foo to your library name
# change Foo::Database to your Sequel database
namespace :bundler do
task :setup do
require 'rubygems'
require 'bundler/setup'
end
end