Skip to content

Commit

Permalink
Merge pull request #726 from epage/deprecated
Browse files Browse the repository at this point in the history
fix!: Remolve deprecated code
  • Loading branch information
epage authored Jan 29, 2025
2 parents a259438 + 41a4237 commit 41e68fe
Show file tree
Hide file tree
Showing 19 changed files with 67 additions and 564 deletions.
8 changes: 2 additions & 6 deletions examples/custom_error.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use winnow::error::AddContext;
use winnow::error::ErrMode;
#[allow(deprecated)]
use winnow::error::ErrorKind;
use winnow::error::FromExternalError;
use winnow::error::ParserError;
use winnow::prelude::*;
Expand All @@ -20,8 +18,7 @@ pub enum CustomError<I> {
impl<I: Stream + Clone> ParserError<I> for CustomError<I> {
type Inner = Self;

#[allow(deprecated)]
fn from_error_kind(input: &I, _: ErrorKind) -> Self {
fn from_input(input: &I) -> Self {
CustomError::Winnow(input.clone())
}

Expand All @@ -46,8 +43,7 @@ impl<I: Stream + Clone, E: std::error::Error + Send + Sync + 'static> FromExtern
for CustomError<I>
{
#[inline]
#[allow(deprecated)]
fn from_external_error(input: &I, _: ErrorKind, e: E) -> Self {
fn from_external_error(input: &I, e: E) -> Self {
CustomError::External {
cause: Box::new(e),
input: input.clone(),
Expand Down
17 changes: 0 additions & 17 deletions src/ascii/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1622,23 +1622,6 @@ where
})
}

/// Deprecated, replaced with [`take_escaped`]
#[deprecated(since = "0.6.4", note = "Replaced with `take_escaped`")]
#[inline(always)]
pub fn escaped<Input, Error, Normal, Escapable, NormalOutput, EscapableOutput>(
normal: Normal,
control_char: char,
escapable: Escapable,
) -> impl Parser<Input, <Input as Stream>::Slice, Error>
where
Input: StreamIsPartial + Stream + Compare<char>,
Normal: Parser<Input, NormalOutput, Error>,
Escapable: Parser<Input, EscapableOutput, Error>,
Error: ParserError<Input>,
{
take_escaped(normal, control_char, escapable)
}

fn escaped_internal<I, Error, F, G, O1, O2, const PARTIAL: bool>(
input: &mut I,
normal: &mut F,
Expand Down
Loading

0 comments on commit 41e68fe

Please sign in to comment.