help me with this: let exons = match strand { '+' => exons, '-' => exons .iter() .map(…
- User
help me with this:
let exons = match strand { '+' => exons, '-' => exons .iter() .map(|(s, e)| (&SCALE - e, &SCALE - s)) .collect() .rev(), _ => return Err("Strand is not + or -"), };error[E0308]: mismatched types --> src/record.rs:85:41 | 85 | .map(|(s, e)| (&SCALE - e, &SCALE - s)) | ^ expected
u64, foundu32error[E0277]: cannot subtract
&u32from&u64--> src/record.rs:85:39 | 85 | .map(|(s, e)| (&SCALE - e, &SCALE - s)) | ^ no implementation for&u64 - &u32| = help: the traitSub<&u32>is not implemented for&u64= help: the following other types implement traitSub<Rhs>: <u64 as Sub<&u64>> <&'a u64 as Sub> <&u64 as Sub<&u64>>error[E0308]: mismatched types --> src/record.rs:85:53 | 85 | .map(|(s, e)| (&SCALE - e, &SCALE - s)) | ^ expected
u64, foundu32error[E0277]: cannot subtract
&u32from&u64--> src/record.rs:85:51 | 85 | .map(|(s, e)| (&SCALE - e, &SCALE - s)) | ^ no implementation for&u64 - &u32| = help: the traitSub<&u32>is not implemented for&u64= help: the following other types implement traitSub<Rhs>: <u64 as Sub<&u64>> <&'a u64 as Sub> <&u64 as Sub<&u64>> - Assistant
The errors you're encountering are due to attempts to subtract references and mixing types (
u32andu64). Rust requires that types match exactly for these kinds of operations and does not perform automatic type casting or de-referencing for you. Let's address these issues: - User
is this the most efficient and fastest way?
- Assistant
- User
- Assistant