diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2020-10-28 11:52:20 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-28 11:52:20 +1100 |
commit | 6844caa9a552e3f8fd1f2139bdffdd090d48fe9a (patch) | |
tree | 5bed5cc8879e8169780d7c4c47ecf1cd3afd53bc /cli/diagnostics.rs | |
parent | dd01f206da0b7e1b305e70cdd3c98bf60fbefc5d (diff) |
fix(cli): restore tripleslash lib refs support (#8157)
Fixes #8147
Diffstat (limited to 'cli/diagnostics.rs')
-rw-r--r-- | cli/diagnostics.rs | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/cli/diagnostics.rs b/cli/diagnostics.rs index ba53ce623..1cd4ea234 100644 --- a/cli/diagnostics.rs +++ b/cli/diagnostics.rs @@ -343,8 +343,19 @@ impl fmt::Display for Diagnostic { } } -#[derive(Clone, Debug, Eq, PartialEq)] -pub struct Diagnostics(pub Vec<Diagnostic>); +#[derive(Clone, Debug, Default, Eq, PartialEq)] +pub struct Diagnostics(Vec<Diagnostic>); + +impl Diagnostics { + #[cfg(test)] + pub fn new(diagnostics: Vec<Diagnostic>) -> Self { + Diagnostics(diagnostics) + } + + pub fn is_empty(&self) -> bool { + self.0.is_empty() + } +} impl<'de> Deserialize<'de> for Diagnostics { fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> |