Add `ProjectCompileOutput::has_compiler_warnings` (#773)

* Add `ProjectCompileOutput::has_compiler_warnings`

* Nits
This commit is contained in:
Bjerg 2022-01-07 16:29:19 +01:00 committed by GitHub
parent 21a4adea3e
commit 86044bc0c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 5 deletions

View File

@ -774,11 +774,12 @@ impl<T: ArtifactOutput> ProjectCompileOutput<T> {
/// Whether there were errors
pub fn has_compiler_errors(&self) -> bool {
if let Some(output) = self.compiler_output.as_ref() {
output.has_error()
} else {
false
}
self.compiler_output.as_ref().map(|o| o.has_error()).unwrap_or_default()
}
/// Whether there were warnings
pub fn has_compiler_warnings(&self) -> bool {
self.compiler_output.as_ref().map(|o| o.has_warning()).unwrap_or_default()
}
/// Finds the first contract with the given name and removes it from the set