diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2023-02-25 14:50:52 +0000 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2023-02-25 14:50:52 +0000 |
commit | 7e02c646edb95ddb4cf2aceeb67888b9d420d930 (patch) | |
tree | bfcd0b3a260ee4e9a1f088c23592969ceb56ce3d /src/error.rs | |
parent | 1455c3f85d8c57c6596fec0f7799e910fdf7af18 (diff) | |
download | subplot-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.rs | 10 |
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() + } } |