apply new rustfmt.toml changes, fix some clippy lints
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
@@ -66,19 +66,25 @@ impl BoolExt for bool {
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn map_ok_or<T, E, F: FnOnce() -> T>(self, err: E, f: F) -> Result<T, E> { self.ok_or(err).map(|()| f()) }
|
||||
fn map_ok_or<T, E, F: FnOnce() -> T>(self, err: E, f: F) -> Result<T, E> {
|
||||
self.ok_or(err).map(|()| f())
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn map_or<T, F: FnOnce() -> T>(self, err: T, f: F) -> T { self.then(f).unwrap_or(err) }
|
||||
|
||||
#[inline]
|
||||
fn map_or_else<T, F: FnOnce() -> T>(self, err: F, f: F) -> T { self.then(f).unwrap_or_else(err) }
|
||||
fn map_or_else<T, F: FnOnce() -> T>(self, err: F, f: F) -> T {
|
||||
self.then(f).unwrap_or_else(err)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn ok_or<E>(self, err: E) -> Result<(), E> { self.into_option().ok_or(err) }
|
||||
|
||||
#[inline]
|
||||
fn ok_or_else<E, F: FnOnce() -> E>(self, err: F) -> Result<(), E> { self.into_option().ok_or_else(err) }
|
||||
fn ok_or_else<E, F: FnOnce() -> E>(self, err: F) -> Result<(), E> {
|
||||
self.into_option().ok_or_else(err)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn or<T, F: FnOnce() -> T>(self, f: F) -> Option<T> { (!self).then(f) }
|
||||
|
||||
Reference in New Issue
Block a user