Skip to content

Commit 2f003f7

Browse files
committed
Add a ton of #[allow(deprecated)] calls to the custom error
This is just to silence the deprecation warnings before Winnow 0.7 comes and destroys everything and I have to rebuild it. Sigh.
1 parent 491a6ac commit 2f003f7

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/parse/error.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Copyright 2023 Lexi Robinson
22
// Licensed under the EUPL-1.2
3+
#[allow(deprecated)]
34
use winnow::error::{
45
AddContext, ContextError, ErrorConvert, ErrorKind, FromExternalError, InputError, ParserError,
56
StrContext,
@@ -10,13 +11,15 @@ use winnow::ModalResult;
1011
/// Because the version of Winnow we're using doesn't let you use `ContextError`
1112
/// with the bit-level parsers I've had to wrap it in a struct I control so I
1213
/// can implement `ErrorConvert` and get it working again
14+
#[allow(deprecated)]
1315
#[derive(Debug, Clone, PartialEq)]
1416
pub struct MBusError(ContextError<StrContext>, ErrorKind);
1517

1618
pub type MBResult<O> = ModalResult<O, MBusError>;
1719

1820
impl MBusError {
1921
pub fn new() -> Self {
22+
#[allow(deprecated)]
2023
Self(ContextError::new(), ErrorKind::Fail)
2124
}
2225

@@ -28,6 +31,7 @@ impl MBusError {
2831
self.0.cause()
2932
}
3033

34+
#[allow(deprecated)]
3135
pub fn kind(&self) -> ErrorKind {
3236
self.1
3337
}
@@ -40,11 +44,14 @@ impl Default for MBusError {
4044
}
4145

4246
impl<I: Stream> ParserError<I> for MBusError {
47+
#[allow(deprecated)]
4348
fn append(self, input: &I, token_start: &<I as Stream>::Checkpoint, kind: ErrorKind) -> Self {
4449
Self(self.0.append(input, token_start, kind), kind)
4550
}
4651

52+
#[allow(deprecated)]
4753
fn from_error_kind(input: &I, kind: ErrorKind) -> Self {
54+
#[allow(deprecated)]
4855
Self(ContextError::from_error_kind(input, kind), kind)
4956
}
5057
}
@@ -67,6 +74,7 @@ impl<I: Stream> AddContext<I, StrContext> for MBusError {
6774
}
6875

6976
impl<I, E: std::error::Error + Send + Sync + 'static> FromExternalError<I, E> for MBusError {
77+
#[allow(deprecated)]
7078
fn from_external_error(input: &I, kind: ErrorKind, e: E) -> Self {
7179
Self(ContextError::from_external_error(input, kind, e), kind)
7280
}
@@ -81,12 +89,14 @@ impl ErrorConvert<MBusError> for MBusError {
8189
// impl<I: Stream> ErrorConvert<InputError<I>> for MBusError {
8290
impl<I: Stream + Clone> ErrorConvert<MBusError> for InputError<I> {
8391
fn convert(self) -> MBusError {
92+
#[allow(deprecated)]
8493
MBusError::from_error_kind(&self.input, self.kind)
8594
}
8695
}
8796

8897
impl ErrorConvert<MBusError> for ContextError<StrContext> {
8998
fn convert(self) -> MBusError {
99+
#[allow(deprecated)]
90100
MBusError(self, ErrorKind::Fail)
91101
}
92102
}

0 commit comments

Comments
 (0)