diff --git a/src/decompose.rs b/src/decompose.rs index 23cdb1a..f945de3 100644 --- a/src/decompose.rs +++ b/src/decompose.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. use core::fmt::{self, Write}; -use core::iter::Fuse; +use core::iter::{Fuse, FusedIterator}; use core::ops::Range; use tinyvec::TinyVec; @@ -151,6 +151,8 @@ impl> Iterator for Decompositions { } } +impl + FusedIterator> FusedIterator for Decompositions {} + impl + Clone> fmt::Display for Decompositions { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { for c in self.clone() { diff --git a/src/recompose.rs b/src/recompose.rs index 2a1960a..4268b0b 100644 --- a/src/recompose.rs +++ b/src/recompose.rs @@ -9,7 +9,10 @@ // except according to those terms. use crate::decompose::Decompositions; -use core::fmt::{self, Write}; +use core::{ + fmt::{self, Write}, + iter::FusedIterator, +}; use tinyvec::TinyVec; #[derive(Clone)] @@ -144,6 +147,8 @@ impl> Iterator for Recompositions { } } +impl + FusedIterator> FusedIterator for Recompositions {} + impl + Clone> fmt::Display for Recompositions { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { for c in self.clone() { diff --git a/src/replace.rs b/src/replace.rs index 8d8cb42..3ab2a57 100644 --- a/src/replace.rs +++ b/src/replace.rs @@ -7,7 +7,10 @@ // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::fmt::{self, Write}; +use core::{ + fmt::{self, Write}, + iter::FusedIterator, +}; use tinyvec::ArrayVec; /// External iterator for replacements for a string's characters. @@ -51,6 +54,8 @@ impl> Iterator for Replacements { } } +impl + FusedIterator> FusedIterator for Replacements {} + impl + Clone> fmt::Display for Replacements { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { for c in self.clone() { diff --git a/src/stream_safe.rs b/src/stream_safe.rs index 30fe810..c1553e3 100644 --- a/src/stream_safe.rs +++ b/src/stream_safe.rs @@ -1,3 +1,5 @@ +use core::iter::FusedIterator; + use crate::lookups::{ canonical_combining_class, canonical_fully_decomposed, compatibility_fully_decomposed, stream_safe_trailing_nonstarters, @@ -59,6 +61,8 @@ impl> Iterator for StreamSafe { } } +impl + FusedIterator> FusedIterator for StreamSafe {} + #[derive(Debug)] pub(crate) struct Decomposition { pub(crate) leading_nonstarters: usize,