Cleaned up imports.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
pub enum Upsert<T> {
|
||||
Created(T),
|
||||
Updated(T),
|
||||
}
|
||||
|
||||
impl<T> Upsert<T> {
|
||||
pub fn try_map<U, E>(self, f: impl FnOnce(T) -> Result<U, E>) -> Result<Upsert<U>, E> {
|
||||
Ok(match self {
|
||||
Self::Created(value) => Upsert::Created(f(value)?),
|
||||
Self::Updated(value) => Upsert::Updated(f(value)?),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
pub enum Delete {
|
||||
Deleted,
|
||||
NotFound,
|
||||
}
|
||||
Reference in New Issue
Block a user