Add more diagnostics

This commit is contained in:
Lucien Greathouse
2019-01-02 14:19:26 -08:00
parent 0aaefe9a66
commit 8c2e430a56
3 changed files with 49 additions and 4 deletions

View File

@@ -2,6 +2,7 @@ use std::{
str,
borrow::Cow,
collections::{HashMap, HashSet},
fmt,
path::PathBuf,
};
@@ -19,6 +20,35 @@ pub struct InstanceChanges {
pub updated: HashSet<RbxId>,
}
impl fmt::Display for InstanceChanges {
fn fmt(&self, output: &mut fmt::Formatter) -> fmt::Result {
writeln!(output, "InstanceChanges {{")?;
if !self.added.is_empty() {
writeln!(output, " Added:")?;
for id in &self.added {
writeln!(output, " {}", id)?;
}
}
if !self.removed.is_empty() {
writeln!(output, " Removed:")?;
for id in &self.removed {
writeln!(output, " {}", id)?;
}
}
if !self.updated.is_empty() {
writeln!(output, " Updated:")?;
for id in &self.updated {
writeln!(output, " {}", id)?;
}
}
writeln!(output, "}}")
}
}
impl InstanceChanges {
pub fn is_empty(&self) -> bool {
self.added.is_empty() && self.removed.is_empty() && self.updated.is_empty()