Skip to content

Instantly share code, notes, and snippets.

@wunki
Created September 15, 2015 13:58
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 wunki/01afade1327512632a75 to your computer and use it in GitHub Desktop.
Save wunki/01afade1327512632a75 to your computer and use it in GitHub Desktop.
closure within struct
extern crate iron;
use iron::prelude::{Request};
struct Resource {
is_available: fn(Request) -> bool
}
fn defaultResource() -> Resource {
Resource{is_available: |_| true}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment