Skip to content

Instantly share code, notes, and snippets.

@sck
Created June 3, 2016 18:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sck/fd66c29430c8fd1558840152727b2a1f to your computer and use it in GitHub Desktop.
Save sck/fd66c29430c8fd1558840152727b2a1f to your computer and use it in GitHub Desktop.
fn describe<F: FnOnce()>(message: &str, func: F) {
println!("{}", message);
func();
}
fn it<F: FnOnce()>(message: &str, func: F) {
println!(" - {}", message);
func();
}
fn main() {
describe("An array", || {
it("Should be empty", || {
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment