These are chat archives for rust-lang/rust
tree.values().cloned().collect()way seems too expensive compared to the aimed goal.
.values().into_iter().collect()seems to work fine
error[E0277]: the trait bound `std::vec::Vec<structure::Player>: std::iter::FromIterator<&structure::Player>` is not satisfied --> src\structure.rs:333:51 | 333 | let players = player_map.values().into_iter().collect(); | ^^^^^^^ a collection of type `std::vec::Vec<structure::Player>` cannot be built from an iterator over elements of type `&structure::Player` | = help: the trait `std::iter::FromIterator<&structure::Player>` is not implemented for `std::vec::Vec<structure::Player>`
btmap.into_iter().map(|(_, x) x|).collect()
Hello and good evening:
I have a problem with the compilation of Rust to Linux x86_64:
I have made a simple project with Cargo and written sample code,
cargo runs as usual and builds the executable file, I can run the executable but when I click on properties I can see the file type is
application/x-sharedlib instead of
Anyone can help me or have an idea what is going on?
I am using Linux Mint 19 cinnamon and Rust toolchain 28.0.
as <integer>drops major bits if not fit. So if I multiply usize and u64 I can get result that doesn't fit in one of them. So at one time I need type that is smaller of two and at another the bigger
u64, you get a compile-time error :-)
as, that's why
clippysuggests, for example,
my_usize as u64
y: u64I can do:
x as u64 * y
x * y as usize
From<usize>according to docs
usizecan be bigger
aswill drop bits silently