diff options
author | David Tolnay <dtolnay@gmail.com> | 2023-05-25 19:58:27 -0700 |
---|---|---|
committer | David Tolnay <dtolnay@gmail.com> | 2023-05-25 19:58:50 -0700 |
commit | 9d48c705ce767c84b7773c3b9f2e182fa539b477 (patch) | |
tree | 8564b5661494a06113c8775a75f98c9cf01487ec /gen/lib/src/error.rs | |
parent | 604593ac3603d7dc261738dfac31313cff4338f4 (diff) | |
download | cxx-9d48c705ce767c84b7773c3b9f2e182fa539b477.tar.gz |
Touch up PR 1214
Diffstat (limited to 'gen/lib/src/error.rs')
-rw-r--r-- | gen/lib/src/error.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gen/lib/src/error.rs b/gen/lib/src/error.rs index b9f7ca39..79a27bd9 100644 --- a/gen/lib/src/error.rs +++ b/gen/lib/src/error.rs @@ -3,6 +3,7 @@ use std::error::Error as StdError; use std::fmt::{self, Debug, Display}; +use std::iter; #[allow(missing_docs)] pub struct Error { @@ -50,14 +51,14 @@ impl IntoIterator for Error { fn into_iter(self) -> Self::IntoIter { match self.err { crate::gen::Error::Syn(err) => IntoIter::Syn(err.into_iter()), - _ => IntoIter::Other(std::iter::once(self)), + _ => IntoIter::Other(iter::once(self)), } } } pub enum IntoIter { Syn(<syn::Error as IntoIterator>::IntoIter), - Other(std::iter::Once<Error>), + Other(iter::Once<Error>), } impl Iterator for IntoIter { @@ -65,10 +66,10 @@ impl Iterator for IntoIter { fn next(&mut self) -> Option<Self::Item> { match self { - IntoIter::Syn(ref mut iter) => iter + IntoIter::Syn(iter) => iter .next() .map(|syn_err| Error::from(crate::gen::Error::Syn(syn_err))), - IntoIter::Other(ref mut iter) => iter.next(), + IntoIter::Other(iter) => iter.next(), } } } |