diff options
Diffstat (limited to 'vendor/nom/src/traits.rs')
-rw-r--r-- | vendor/nom/src/traits.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/vendor/nom/src/traits.rs b/vendor/nom/src/traits.rs index 3c3053e89..394e5bc3a 100644 --- a/vendor/nom/src/traits.rs +++ b/vendor/nom/src/traits.rs @@ -914,6 +914,18 @@ impl<'a> FindToken<char> for &'a str { } } +impl<'a> FindToken<char> for &'a [char] { + fn find_token(&self, token: char) -> bool { + self.iter().any(|i| *i == token) + } +} + +impl<'a, 'b> FindToken<&'a char> for &'b [char] { + fn find_token(&self, token: &char) -> bool { + self.find_token(*token) + } +} + /// Look for a substring in self pub trait FindSubstring<T> { /// Returns the byte position of the substring if it is found @@ -1318,6 +1330,10 @@ impl<I> ErrorConvert<error::VerboseError<(I, usize)>> for error::VerboseError<I> } } +impl ErrorConvert<()> for () { + fn convert(self) {} +} + #[cfg(feature = "std")] #[cfg_attr(feature = "docsrs", doc(cfg(feature = "std")))] /// Helper trait to show a byte slice as a hex dump |