add util functors for is_zero/is_equal; move clamp to math utils
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
bd75ff65c9
commit
63053640f1
3 changed files with 39 additions and 15 deletions
|
@ -41,8 +41,5 @@ pub(crate) fn camel_to_snake_string(s: &str) -> String {
|
|||
output
|
||||
}
|
||||
|
||||
pub(crate) fn exchange<T: Clone>(state: &mut T, source: T) -> T {
|
||||
let ret = state.clone();
|
||||
*state = source;
|
||||
ret
|
||||
}
|
||||
#[inline]
|
||||
pub(crate) fn exchange<T>(state: &mut T, source: T) -> T { std::mem::replace(state, source) }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue