Skip to content

Commit

Permalink
fix warnings on nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
tiffany352 committed Jun 2, 2024
1 parent 5859e92 commit df8b961
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 16 deletions.
12 changes: 0 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ serde = { version = "1", features = ["rc"], default-features = false }
serde_derive = "1"
indexmap = "2"

[dev_dependencies]
[dev-dependencies]
serde_json = { version = "1", default-features = false }
assert-json-diff = "2.0.1"
similar-asserts = "1.1.0"
1 change: 0 additions & 1 deletion sandbox/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ categories = ["command-line-utilities"]
[dependencies]
async-std = { version = "1.9", features = ["std", "unstable", "default"], default-features = false }
bincode = "1.3.3"
displaydoc = { version = "0.2", default-features = false }
thiserror = "1"
serde_derive = "1"
serde = { version = "1", default-features = false }
Expand Down
23 changes: 21 additions & 2 deletions sandbox/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

use async_std::channel::RecvError;
use displaydoc::Display;
use core::fmt;
use serde_derive::{Deserialize, Serialize};
use std::{io::Error as IoError, time::Duration};
use thiserror::Error;

/// All of the errors that can result while managing the child process.
#[derive(Error, Display, Debug)]
#[derive(Error, Debug)]
#[non_exhaustive]
pub enum Error {
/// IO error
Expand Down Expand Up @@ -38,6 +38,25 @@ pub enum Error {
Interrupted,
}

impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Error::Io(_) => write!(f, "IO error"),
Error::Recv(err) => write!(f, "{}", err),
Error::Send(err) => write!(f, "Failed to send {err}"),
Error::Timeout(err) => write!(f, "Timed out after {err:?}"),
Error::Bincode(_) => write!(f, "Bincode"),
Error::Panic(err) => write!(f, "Panic: {err}"),
Error::InitFailure(_) => write!(f, "Failed to start child process"),
Error::ReadFailed(_) => write!(f, "Failed to read from child"),
Error::WriteFailed(_) => write!(f, "Failed to write to child"),
Error::HandshakeFailure(err) => write!(f, "Failed to start child process: {err}"),
Error::Crashed => write!(f, "Child process crashed"),
Error::Interrupted => write!(f, "Interrupted"),
}
}
}

impl From<IoError> for Error {
fn from(err: IoError) -> Self {
Error::Io(err)
Expand Down

0 comments on commit df8b961

Please sign in to comment.