Skip to content

Instantly share code, notes, and snippets.

@yuriks
Created April 18, 2014 04:00
Show Gist options
  • Select an option

  • Save yuriks/11024298 to your computer and use it in GitHub Desktop.

Select an option

Save yuriks/11024298 to your computer and use it in GitHub Desktop.
let mut files = LruCache::new(8);
let file = match files.get(file_info.name) {
Some(f) => f,
None => {
let f = open_file(file_info.name);
files.put(file_info.name, f);
files.get(file_info.name)
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment