From 3bc0ff8d3032b7a9416e8aeaa45a7d87d3466cdf Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 8 Apr 2023 09:56:45 +0200 Subject: Run cargo-fmt Signed-off-by: Matthias Beyer --- src/lib.rs | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 9dfe3cf..228699c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,22 +2,25 @@ //! pub trait OptionInspect - where F: FnOnce(&T), - T: Sized +where + F: FnOnce(&T), + T: Sized, { fn inspect(self, f: F) -> Self; } pub trait OptionInspectRef - where F: FnOnce(&T), - T: Sized +where + F: FnOnce(&T), + T: Sized, { fn inspect(&self, f: F); } impl OptionInspect for Option - where F: FnOnce(&T), - T: Sized +where + F: FnOnce(&T), + T: Sized, { fn inspect(self, f: F) -> Self { if let Some(ref o) = self.as_ref() { @@ -29,8 +32,9 @@ impl OptionInspect for Option } impl OptionInspectRef for Option - where F: FnOnce(&T), - T: Sized +where + F: FnOnce(&T), + T: Sized, { fn inspect(&self, f: F) { if let Some(ref o) = self { @@ -39,21 +43,23 @@ impl OptionInspectRef for Option } } - pub trait OptionInspectNone - where F: FnOnce(), +where + F: FnOnce(), { fn inspect_none(self, f: F) -> Self; } pub trait OptionInspectNoneRef - where F: FnOnce(), +where + F: FnOnce(), { fn inspect_none(&self, f: F); } impl OptionInspectNone for Option - where F: FnOnce() +where + F: FnOnce(), { fn inspect_none(self, f: F) -> Self { if let None = self.as_ref() { @@ -65,7 +71,8 @@ impl OptionInspectNone for Option } impl OptionInspectNoneRef for Option - where F: FnOnce() +where + F: FnOnce(), { fn inspect_none(&self, f: F) { if let None = self { -- cgit v1.2.3