Skip to content

Instantly share code, notes, and snippets.

@gyng
Last active December 2, 2015 07:08
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 gyng/c195aac3c25815c4b473 to your computer and use it in GitHub Desktop.
Save gyng/c195aac3c25815c4b473 to your computer and use it in GitHub Desktop.
E:\Projects\ireul [(e8b3637...) +2 ~3 -0 !]> cargo test
Compiling ireul v0.0.1 (file:///E:/Projects/ireul)
src/core\queue.rs:126:13: 126:18 error: cannot move out of borrowed content [E0507]
src/core\queue.rs:126 track.comments.unwrap().comments.iter().filter_map(|comment|
^~~~~
error: aborting due to previous error
Could not compile `ireul`.
pub fn get_queue_by_fields(&mut self, fields: &Vec<String>) -> Vec<Vec<(String, String)>> {
self.items.iter().map(|track| {
track.comments.unwrap().comments.iter().filter_map(|comment|
match fields.binary_search(&comment.0) {
Ok(_) => Some(comment.clone()),
Err(_) => None
}
).collect()
}).collect()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment