diff options
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 17 |
1 files changed, 0 insertions, 17 deletions
@@ -5,20 +5,3 @@ pub mod manager; | |||
5 | pub mod status; | 5 | pub mod status; |
6 | 6 | ||
7 | pub(crate) static DATE_FMT: &str = "%e %b %y"; | 7 | pub(crate) static DATE_FMT: &str = "%e %b %y"; |
8 | |||
9 | pub trait PrintResult { | ||
10 | fn print(&self); | ||
11 | } | ||
12 | |||
13 | impl<T, E> PrintResult for Result<T, E> | ||
14 | where | ||
15 | T: std::fmt::Display, | ||
16 | E: std::fmt::Display, | ||
17 | { | ||
18 | fn print(&self) { | ||
19 | match self { | ||
20 | Ok(ok) => println!("{ok}"), | ||
21 | Err(err) => eprintln!("{err}"), | ||
22 | } | ||
23 | } | ||
24 | } | ||