mirror of
https://github.com/rosenpass/rosenpass.git
synced 2026-01-12 13:15:23 -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
|
|
}
|