summaryrefslogtreecommitdiffstats
path: root/src/package/tree.rs
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2020-11-05 12:06:58 +0100
committerMatthias Beyer <mail@beyermatthias.de>2020-11-05 12:06:58 +0100
commit3170c9ed14e22c5baa41618326a4db02389da445 (patch)
tree4677aad26e32b0e99d3bff0a37509d5ced712052 /src/package/tree.rs
parent7bbcca0356795ac60bf7761819b56430e0905a3c (diff)
Derive Serialize for all types
Because we want to write the whole Tree object into the database as JSON, we need to be able to serialize all these types. Some of them (which had no implementation of Deserialize) also got an implementation of Deserialize, because we also want to be able to read them from the database and print them to the user. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src/package/tree.rs')
-rw-r--r--src/package/tree.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/package/tree.rs b/src/package/tree.rs
index 07ea204..94d726b 100644
--- a/src/package/tree.rs
+++ b/src/package/tree.rs
@@ -4,11 +4,13 @@ use anyhow::Result;
use anyhow::anyhow;
use indicatif::ProgressBar;
use resiter::AndThen;
+use serde::Serialize;
+use serde::Deserialize;
use crate::repository::Repository;
use crate::package::Package;
-#[derive(Debug)]
+#[derive(Debug, Serialize, Deserialize)]
pub struct Tree {
root: BTreeMap<Package, Tree>,
}