Skip to content

Instantly share code, notes, and snippets.

@ihodes
Last active August 29, 2015 14:09
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 ihodes/de5de08abb2ecc1bd35f to your computer and use it in GitHub Desktop.
Save ihodes/de5de08abb2ecc1bd35f to your computer and use it in GitHub Desktop.
./src/main.rs:58:13: 58:107 error: cannot infer an appropriate lifetime for lifetime parameter 'r in function call due to conflicting requirements
./src/main.rs:58 filtered.skip_while(|l| from_str::<uint>(l.clone().unwrap().as_slice()).unwrap() | bf == 1u )
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./src/main.rs:58:33: 58:105 note: first, the lifetime cannot outlive the expression at 58:32...
./src/main.rs:58 filtered.skip_while(|l| from_str::<uint>(l.clone().unwrap().as_slice()).unwrap() | bf == 1u )
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./src/main.rs:58:33: 58:105 note: ...so type `|&core::result::Result<collections::string::String, std::io::IoError>| -> bool` of expression is valid during the expression
./src/main.rs:58 filtered.skip_while(|l| from_str::<uint>(l.clone().unwrap().as_slice()).unwrap() | bf == 1u )
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./src/mpain.rs:57:21: 59:10 note: but, the lifetime must be valid for the expression at 57:20...
./src/main.rs:57 Some(bf) => {
./src/main.rs:58 filtered.skip_while(|l| from_str::<uint>(l.clone().unwrap().as_slice()).unwrap() | bf == 1u )
./src/main.rs:59 }
./src/main.rs:57:21: 59:10 note: ...so type `core::iter::SkipWhile<'_, core::result::Result<collections::string::String, std::io::IoError>, core::iter::SkipWhile<'_, core::result::Result<collections::string::String, std::io::IoError>, std::io::Lines<'_, std::io::buffered::BufferedReader<core::result::Result<std::io::fs::File, std::io::IoError>>>>>` of expression is valid during the expression
./src/main.rs:57 Some(bf) => {
./src/main.rs:58 filtered.skip_while(|l| from_str::<uint>(l.clone().unwrap().as_slice()).unwrap() | bf == 1u )
./src/main.rs:59 }
let filtered = match bit_field {
None => { filtered.skip_while(|_| false ) },
Some(bf) => {
filtered.skip_while(|l| from_str::<uint>(l.clone().unwrap().as_slice()).unwrap() | bf == 1u )
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment