summaryrefslogtreecommitdiff
path: root/src/error.rs
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2023-02-25 14:50:52 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2023-02-25 14:50:52 +0000
commit7e02c646edb95ddb4cf2aceeb67888b9d420d930 (patch)
treebfcd0b3a260ee4e9a1f088c23592969ceb56ce3d /src/error.rs
parent1455c3f85d8c57c6596fec0f7799e910fdf7af18 (diff)
downloadsubplot-7e02c646edb95ddb4cf2aceeb67888b9d420d930.tar.gz
(Warnings): Add is_empty() and len()
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs
index 0ac2abf..2469a5b 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -404,4 +404,14 @@ impl Warnings {
pub fn warnings(&self) -> &[Warning] {
&self.warnings
}
+
+ /// Is the underlying warning set empty?
+ pub fn is_empty(&self) -> bool {
+ self.warnings.is_empty()
+ }
+
+ /// The number of warninings
+ pub fn len(&self) -> usize {
+ self.warnings.len()
+ }
}