pub trait VecUtils<T> {
// Required methods
fn push_if(&mut self, push: T, cond: bool);
fn push_if_with<F: FnOnce() -> T>(&mut self, cond: bool, f: F);
}Expand description
Conditional vector push helpers.
Required Methods§
Sourcefn push_if_with<F: FnOnce() -> T>(&mut self, cond: bool, f: F)
fn push_if_with<F: FnOnce() -> T>(&mut self, cond: bool, f: F)
Lazily evaluates and pushes the value if cond is true.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.