mirror of
https://github.com/rosenpass/rosenpass.git
synced 2026-02-28 06:23:08 -08:00
feat(API): Close API connections after error
This commit is contained in:
@@ -136,3 +136,17 @@ impl<T: Default> SwapWithDefaultExt for T {
|
||||
self.swap_with(Self::default())
|
||||
}
|
||||
}
|
||||
|
||||
pub trait MoveExt {
|
||||
/// Deliberately move the value
|
||||
///
|
||||
/// Usually employed to enforce an object being
|
||||
/// dropped after use.
|
||||
fn move_here(self) -> Self;
|
||||
}
|
||||
|
||||
impl<T: Sized> MoveExt for T {
|
||||
fn move_here(self) -> Self {
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user