Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions crates/hyperqueue/src/common/parser2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ use tako::resources::{FRACTIONS_MAX_DIGITS, ResourceAmount};

#[derive(Clone, Debug, PartialEq)]
pub struct ParseError {
error: Simple<String>,
error: Box<Simple<String>>,
}

impl ParseError {
/// Create an error with a custom error message.
pub fn custom<M: ToString>(span: <Self as Error<char>>::Span, msg: M) -> Self {
Self {
error: Simple::custom(span, msg),
error: Box::new(Simple::custom(span, msg)),
}
}

Expand All @@ -26,7 +26,7 @@ impl ParseError {
found: Option<String>,
) -> Self {
Self {
error: Simple::expected_input_found(span, expected, found),
error: Box::new(Simple::expected_input_found(span, expected, found)),
}
}

Expand Down Expand Up @@ -67,19 +67,25 @@ impl Error<char> for ParseError {
) -> Self {
let expected = expected.into_iter().map(|c| c.map(|c| c.to_string()));
Self {
error: Simple::expected_input_found(span, expected, found.map(|c| c.to_string())),
error: Box::new(Simple::expected_input_found(
span,
expected,
found.map(|c| c.to_string()),
)),
}
}

fn with_label(self, label: Self::Label) -> Self {
Self {
error: self.error.with_label(label),
error: Box::new(self.error.with_label(label)),
}
}

fn merge(self, other: Self) -> Self {
let merged = self.error.merge(other.error);
Self { error: merged }
let merged = self.error.merge(*other.error);
Self {
error: Box::new(merged),
}
}
}

Expand Down
3 changes: 3 additions & 0 deletions crates/hyperqueue/src/server/autoalloc/service.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SendError<AutoAllocMessage> is large but that is acceptable here.
#![allow(clippy::result_large_err)]

use std::future::Future;
use std::path::{Path, PathBuf};
use std::time::Duration;
Expand Down
Loading