Skip to content

Commit 80c0017

Browse files
committed
Fix clippy warning on rustc 1.94.0
1 parent 4a0230e commit 80c0017

2 files changed

Lines changed: 16 additions & 7 deletions

File tree

crates/hyperqueue/src/common/parser2.rs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ use tako::resources::{FRACTIONS_MAX_DIGITS, ResourceAmount};
99

1010
#[derive(Clone, Debug, PartialEq)]
1111
pub struct ParseError {
12-
error: Simple<String>,
12+
error: Box<Simple<String>>,
1313
}
1414

1515
impl ParseError {
1616
/// Create an error with a custom error message.
1717
pub fn custom<M: ToString>(span: <Self as Error<char>>::Span, msg: M) -> Self {
1818
Self {
19-
error: Simple::custom(span, msg),
19+
error: Box::new(Simple::custom(span, msg)),
2020
}
2121
}
2222

@@ -26,7 +26,7 @@ impl ParseError {
2626
found: Option<String>,
2727
) -> Self {
2828
Self {
29-
error: Simple::expected_input_found(span, expected, found),
29+
error: Box::new(Simple::expected_input_found(span, expected, found)),
3030
}
3131
}
3232

@@ -67,19 +67,25 @@ impl Error<char> for ParseError {
6767
) -> Self {
6868
let expected = expected.into_iter().map(|c| c.map(|c| c.to_string()));
6969
Self {
70-
error: Simple::expected_input_found(span, expected, found.map(|c| c.to_string())),
70+
error: Box::new(Simple::expected_input_found(
71+
span,
72+
expected,
73+
found.map(|c| c.to_string()),
74+
)),
7175
}
7276
}
7377

7478
fn with_label(self, label: Self::Label) -> Self {
7579
Self {
76-
error: self.error.with_label(label),
80+
error: Box::new(self.error.with_label(label)),
7781
}
7882
}
7983

8084
fn merge(self, other: Self) -> Self {
81-
let merged = self.error.merge(other.error);
82-
Self { error: merged }
85+
let merged = self.error.merge(*other.error);
86+
Self {
87+
error: Box::new(merged),
88+
}
8389
}
8490
}
8591

crates/hyperqueue/src/server/autoalloc/service.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// SendError<AutoAllocMessage> is large but that is acceptable here.
2+
#![allow(clippy::result_large_err)]
3+
14
use std::future::Future;
25
use std::path::{Path, PathBuf};
36
use std::time::Duration;

0 commit comments

Comments
 (0)