You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can't move the captured variable init out of the "init" func if it is a non-Copy type, even though init variable has been moved into the capturing "init" func. That's because FnMut means "init" can be called multiple times. This only works as a matter of fact that init variable is i64 in this case.
Since this func is called only once, FnOnce is more suitable here.
The text was updated successfully, but these errors were encountered:
with the way the Parser trait is designed, it cannot be a FnOnce, because there's no guarantee that the parser would be called only once: you can take the result of fold and call parse on it with various inputs
Take this for example
nom/tests/arithmetic.rs
Line 60 in 90af84b
You can't move the captured variable
init
out of the "init" func if it is a non-Copy type, even thoughinit
variable has been moved into the capturing "init" func. That's because FnMut means "init" can be called multiple times. This only works as a matter of fact thatinit
variable isi64
in this case.Since this func is called only once, FnOnce is more suitable here.
The text was updated successfully, but these errors were encountered: