diff --git a/src/stream/mod.rs b/src/stream/mod.rs index 79c79111..452e2179 100644 --- a/src/stream/mod.rs +++ b/src/stream/mod.rs @@ -174,6 +174,17 @@ where is_recoverable: bool, } +#[cfg(feature = "unstable-recover")] +#[cfg(feature = "std")] +impl Default for Recoverable +where + I: Default + Stream, +{ + fn default() -> Self { + Self::new(I::default()) + } +} + #[cfg(feature = "unstable-recover")] #[cfg(feature = "std")] impl Recoverable @@ -298,7 +309,7 @@ impl /// let output = word.parse(input).unwrap(); /// assert_eq!(state.get(), 1); /// ``` -#[derive(Clone, Copy, Eq, PartialEq)] +#[derive(Clone, Copy, Default, Eq, PartialEq)] #[doc(alias = "LocatedSpan")] pub struct Stateful { /// Inner input being wrapped in state