aboutsummaryrefslogtreecommitdiff
path: root/cli/src/stats.rs
diff options
context:
space:
mode:
authorTill Höppner2016-03-09 18:56:15 +0100
committerTill Höppner2016-03-09 18:56:15 +0100
commita04f7c45e5f6e0d656d6e6a87d63ce2bcaa0865b (patch)
treecbe502d0287b4d40a3cee98d433973a4336ae710 /cli/src/stats.rs
parent58c249954e7bb8776f213248d9ca220a27c372b7 (diff)
downloadilc-a04f7c45e5f6e0d656d6e6a87d63ce2bcaa0865b.tar.gz
ilc-a04f7c45e5f6e0d656d6e6a87d63ce2bcaa0865b.tar.xz
ilc-a04f7c45e5f6e0d656d6e6a87d63ce2bcaa0865b.zip
Mock .git for packaging purposes
Diffstat (limited to 'cli/src/stats.rs')
-rw-r--r--cli/src/stats.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/cli/src/stats.rs b/cli/src/stats.rs
index 390a200..8c92cc6 100644
--- a/cli/src/stats.rs
+++ b/cli/src/stats.rs
@@ -13,7 +13,7 @@ use error;
struct StatFormat {
version: String,
- master_hash: String,
+ master_hash: Option<String>,
time: String,
stats: Stats,
}
@@ -28,7 +28,9 @@ impl Serialize for StatFormat {
where S: Serializer
{
try!(s.serialize_struct_elt("version", &self.0.version));
- try!(s.serialize_struct_elt("master_hash", &self.0.master_hash));
+ if let &Some(ref h) = &self.0.master_hash {
+ try!(s.serialize_struct_elt("master_hash", h));
+ }
try!(s.serialize_struct_elt("time", &self.0.time));
try!(s.serialize_struct_elt("stats", &self.0.stats));
Ok(None)