diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2020-11-05 12:06:58 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2020-11-05 12:08:29 +0100 |
commit | 700ef542d6cf874ad4cf80e0253fc8820962504b (patch) | |
tree | ac4abefb04841100d402bfb864e8bd55a553a204 /src/package/version.rs | |
parent | 51c0e6284fbf8e1ea2184a6cd279fd9bbe4ed293 (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>
(cherry picked from commit 3170c9ed14e22c5baa41618326a4db02389da445)
Diffstat (limited to 'src/package/version.rs')
-rw-r--r-- | src/package/version.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/package/version.rs b/src/package/version.rs index da8af89..25012f1 100644 --- a/src/package/version.rs +++ b/src/package/version.rs @@ -1,5 +1,6 @@ use std::ops::Deref; +use serde::Serialize; use serde::Deserialize; use anyhow::anyhow; use anyhow::Error; @@ -33,7 +34,7 @@ impl PackageVersionConstraint { } } -#[derive(Deserialize, Clone, Debug, Hash, Eq, PartialEq, Ord, PartialOrd)] +#[derive(Serialize, Deserialize, Clone, Debug, Hash, Eq, PartialEq, Ord, PartialOrd)] #[serde(transparent)] pub struct PackageVersion(String); |