python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
Rust borrow checker and early returns
Rust-lang Playground link
struct Foo {
val: i32
}
impl Foo {
pub fn maybe_get(&mut self) -> Option<&mut i32> {
Some(&mut self.val)
}
pub fn definitel...
quittle
Votes: 0
Answers: 1
Multiple mutable queries with Legion ECS
I am using the Legion ECS and trying to use multiple mutable queries and running into some borrow checker constraints.
I basically want to update the state of components by comparing with all of the o...
Toby Hede
Votes: 0
Answers: 1
Borrow error when attempting recursion on HashMap, where each value needs a reference to the map
I'm currently have an issue regarding Rust's borrowing policy.
I have a HashMap of structs 'Value', each which contains a list of keys to other Values in HashMap. I am attempting to recursively call a...
Dimitri_3gg
Votes: 0
Answers: 1
Rust mutable references working in some cases but not in other cases
I've encountered a problem that I cannot understand involving mutable references and borrow checker.
I am writing a naive binary search tree using safe rust. Full code can be seen here: https://github...

Maksim Gayduk
Votes: 0
Answers: 2