diff options
Diffstat (limited to 'lib/src/lib.rs')
-rw-r--r-- | lib/src/lib.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/src/lib.rs b/lib/src/lib.rs index 41e38c8..c2f24c6 100644 --- a/lib/src/lib.rs +++ b/lib/src/lib.rs | |||
@@ -56,6 +56,13 @@ impl Report { | |||
56 | .flat_map(|d| Some(d.suggestion.as_ref()?.at)) | 56 | .flat_map(|d| Some(d.suggestion.as_ref()?.at)) |
57 | .reduce(|acc, next| acc.cover(next)) | 57 | .reduce(|acc, next| acc.cover(next)) |
58 | } | 58 | } |
59 | /// A range that encompasses all the diagnostics provided in this report | ||
60 | pub fn total_diagnostic_range(&self) -> Option<TextRange> { | ||
61 | self.diagnostics | ||
62 | .iter() | ||
63 | .flat_map(|d| Some(d.at)) | ||
64 | .reduce(|acc, next| acc.cover(next)) | ||
65 | } | ||
59 | /// Unsafe but handy replacement for above | 66 | /// Unsafe but handy replacement for above |
60 | pub fn range(&self) -> TextRange { | 67 | pub fn range(&self) -> TextRange { |
61 | self.total_suggestion_range().unwrap() | 68 | self.total_suggestion_range().unwrap() |