Skip to content

Commit

Permalink
Fix std/no-std incompatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
devrandom committed Apr 16, 2024
1 parent 1066cca commit 56ab9b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/test.rs
Expand Up @@ -7,7 +7,7 @@
//! ```


use serde_json::io::{Write, Result, Error};
use serde_json::io::{Write, Result, Error, ErrorKind};

struct X {
}
Expand All @@ -18,7 +18,7 @@ impl Write for X {
}

fn flush(&mut self) -> Result<()> {
Err(Error {})
Err(Error::new(ErrorKind::Other, "flush not implemented"))
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/io/core.rs
Expand Up @@ -23,7 +23,8 @@ impl Display for Error {
}

impl Error {
pub(crate) fn new(_kind: ErrorKind, _error: &'static str) -> Error {
/// see [`std::io::Error::new`]
pub fn new(_kind: ErrorKind, _error: &'static str) -> Error {
Error
}
}
Expand Down

0 comments on commit 56ab9b1

Please sign in to comment.