summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorAkshay <[email protected]>2023-05-20 13:13:05 +0100
committerAkshay <[email protected]>2023-05-20 13:13:05 +0100
commitdea860819e7c0439debfcdd3050408e1e6cef10f (patch)
treebd57346768a64ffe61b64e1abc7b134233040e1a /src/lib.rs
parentf13e8be9f32c5ca7f70dc809e3d43144f8e31396 (diff)
add base cli
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index b66a7b4..867a09c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -3,3 +3,20 @@ pub mod error;
3pub mod feed; 3pub mod feed;
4pub mod manager; 4pub mod manager;
5pub mod status; 5pub mod status;
6
7pub trait PrintResult {
8 fn print(&self);
9}
10
11impl<T, E> PrintResult for Result<T, E>
12where
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}