Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Use trait Error from core #1179

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ authors = [
]
license = "Apache-2.0"
repository = "https://github.com/tokio-rs/prost"
rust-version = "1.71.1"
rust-version = "1.81"
edition = "2021"

[profile.bench]
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benches/dataset.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use core::error::Error;
use criterion::{criterion_group, criterion_main, Criterion};
use prost::Message;
use std::error::Error;

pub mod benchmarks {
include!(concat!(env!("OUT_DIR"), "/benchmarks.rs"));
Expand Down
3 changes: 1 addition & 2 deletions prost-types/src/duration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,7 @@ impl fmt::Display for DurationError {
}
}

#[cfg(feature = "std")]
impl std::error::Error for DurationError {}
impl core::error::Error for DurationError {}

impl FromStr for Duration {
type Err = DurationError;
Expand Down
3 changes: 1 addition & 2 deletions prost-types/src/timestamp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,7 @@ impl fmt::Display for TimestampError {
}
}

#[cfg(feature = "std")]
impl std::error::Error for TimestampError {}
impl core::error::Error for TimestampError {}

#[cfg(feature = "std")]
impl TryFrom<Timestamp> for std::time::SystemTime {
Expand Down
9 changes: 3 additions & 6 deletions prost/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ impl fmt::Display for DecodeError {
}
}

#[cfg(feature = "std")]
impl std::error::Error for DecodeError {}
impl core::error::Error for DecodeError {}

#[cfg(feature = "std")]
impl From<DecodeError> for std::io::Error {
Expand Down Expand Up @@ -122,8 +121,7 @@ impl fmt::Display for EncodeError {
}
}

#[cfg(feature = "std")]
impl std::error::Error for EncodeError {}
impl core::error::Error for EncodeError {}

#[cfg(feature = "std")]
impl From<EncodeError> for std::io::Error {
Expand All @@ -146,5 +144,4 @@ impl fmt::Display for UnknownEnumValue {
}
}

#[cfg(feature = "std")]
impl std::error::Error for UnknownEnumValue {}
impl core::error::Error for UnknownEnumValue {}