summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
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}