Skip to content
Merged
Changes from 1 commit
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
Next Next commit
Idiomatic Rust returns for Error conversions
  • Loading branch information
medwards authored and bjgill committed Jun 7, 2019
commit 25b12a9d5802684a2e316b01457b9a159970a5c2
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ pub enum Error {

impl From<reqwest::Error> for Error {
fn from(e: reqwest::Error) -> Self {
return Error::Reqwest(e)
Error::Reqwest(e)
}
}

impl From<serde_json::Error> for Error {
fn from(e: serde_json::Error) -> Self {
return Error::Serde(e)
Error::Serde(e)
}
}

impl From<std::io::Error> for Error {
fn from(e: std::io::Error) -> Self {
return Error::Io(e)
Error::Io(e)
}
}

Expand Down