diff options
author | Akshay <[email protected]> | 2023-05-20 13:13:05 +0100 |
---|---|---|
committer | Akshay <[email protected]> | 2023-05-20 13:13:05 +0100 |
commit | dea860819e7c0439debfcdd3050408e1e6cef10f (patch) | |
tree | bd57346768a64ffe61b64e1abc7b134233040e1a /src/lib.rs | |
parent | f13e8be9f32c5ca7f70dc809e3d43144f8e31396 (diff) |
add base cli
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -3,3 +3,20 @@ pub mod error; | |||
3 | pub mod feed; | 3 | pub mod feed; |
4 | pub mod manager; | 4 | pub mod manager; |
5 | pub mod status; | 5 | pub mod status; |
6 | |||
7 | pub trait PrintResult { | ||
8 | fn print(&self); | ||
9 | } | ||
10 | |||
11 | impl<T, E> PrintResult for Result<T, E> | ||
12 | where | ||
13 | T: std::fmt::Display, | ||
14 | E: std::fmt::Display, | ||
15 | { | ||
16 | fn print(&self) { | ||
17 | match self { | ||
18 | Ok(ok) => println!("{ok}"), | ||
19 | Err(err) => eprintln!("{err}"), | ||
20 | } | ||
21 | } | ||
22 | } | ||