From fcf973c16d4128dda76b809b0d5b9a2635afae47 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Wed, 24 Apr 2019 09:56:27 +0200 Subject: Add missing "ComparePackage" type Because we cannot build a "Package" from the compare file (because we shouldn't, because we only need _some_ information about the package), we should use a special helper type for deserializing the contents of the file. --- src/compare.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/compare.rs (limited to 'src/compare.rs') diff --git a/src/compare.rs b/src/compare.rs new file mode 100644 index 0000000..c13d01e --- /dev/null +++ b/src/compare.rs @@ -0,0 +1,15 @@ +#[derive(Serialize, Deserialize, Debug, Eq, PartialEq)] +pub struct ComparePackage { + name: String, + version: String, +} + +impl ComparePackage { + pub fn name(&self) -> &String { + &self.name + } + + pub fn version(&self) -> &String { + &self.version + } +} \ No newline at end of file -- cgit v1.2.3