mirror of
https://github.com/rosenpass/rosenpass.git
synced 2025-12-25 20:34:52 -08:00
16 lines
177 B
Rust
16 lines
177 B
Rust
pub fn mutating<T, F>(mut v: T, f: F) -> T
|
|
where
|
|
F: Fn(&mut T),
|
|
{
|
|
f(&mut v);
|
|
v
|
|
}
|
|
|
|
pub fn sideeffect<T, F>(v: T, f: F) -> T
|
|
where
|
|
F: Fn(&T),
|
|
{
|
|
f(&v);
|
|
v
|
|
}
|