python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
Is there any way to not link the lifetime of the iterator to the struct?
I am trying to implement a filter function which receives an iterator to a vector and returns an iterator with the filter. Is there any way by which I don't link the lifetime of the iterator to the st...
Richa Jain
Votes: 0
Answers: 1
Why is the move keyword needed when returning a closure which captures a Copy type?
godbolt
fn foo(c: char) -> impl Fn() -> i32 {
|| bar(c)
}
fn bar(_: char) -> i32 {
42
}
Which throws an error
error[E0597]: `c` does not live long enough
--> src/lib.rs:2:12
|...
skelix
Votes: 0
Answers: 2
Satisfying lifetimes for traits that are required by one another
Im trying to write a basic nary tree, where I have several traits that are all intended to work on structs which will form the nodes of the tree. These structs will have mutable references to the othe...
m.tracey
Votes: 0
Answers: 0
Array of references that share an Arc
This one's kind of an open ended design question I'm afraid.
Anyway: I have a big two-dimensional array of stuff. This array is mutable, and is accessed by a bunch of threads. For now I've just been d...
Edward Peters
Votes: 0
Answers: 1