Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1af89a1

Browse files
committedMar 31, 2025·
uguid: Unconditionally use the Error trait
1 parent 32b4a7e commit 1af89a1

File tree

4 files changed

+6
-10
lines changed

4 files changed

+6
-10
lines changed
 

‎uguid/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Unreleased
22

33
* MSRV increased to 1.81.
4+
* The `Error` trait is now unconditionally implemented for `GuidFromStrError`.
45

56
# 2.2.0
67

‎uguid/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ No features are enabled by default.
1414

1515
* `bytemuck`: Implements bytemuck's `Pod` and `Zeroable` traits for `Guid`.
1616
* `serde`: Implements serde's `Serialize` and `Deserialize` traits for `Guid`.
17-
* `std`: Provides `std::error::Error` implementation for the error type.
17+
* `std`: Currently has no effect.
1818

1919
## Minimum Supported Rust Version (MSRV)
2020

‎uguid/src/error.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ use core::fmt::{self, Display, Formatter};
1010

1111
/// Error type for [`Guid::try_parse`] and [`Guid::from_str`].
1212
///
13-
/// If the `std` feature is enabled, this type implements the [`Error`]
14-
/// trait.
15-
///
16-
/// [`Error`]: std::error::Error
1713
/// [`Guid::from_str`]: core::str::FromStr::from_str
1814
/// [`Guid::try_parse`]: crate::Guid::try_parse
1915
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash, Ord, PartialOrd)]
@@ -53,3 +49,5 @@ impl Display for GuidFromStrError {
5349
}
5450
}
5551
}
52+
53+
impl core::error::Error for GuidFromStrError {}

‎uguid/src/lib.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
//!
2424
//! * `bytemuck`: Implements bytemuck's `Pod` and `Zeroable` traits for `Guid`.
2525
//! * `serde`: Implements serde's `Serialize` and `Deserialize` traits for `Guid`.
26-
//! * `std`: Provides `std::error::Error` implementation for the error type.
26+
//! * `std`: Currently has no effect.
2727
//!
2828
//! # Examples
2929
//!
@@ -82,7 +82,7 @@
8282
//! );
8383
//! ```
8484
85-
#![cfg_attr(not(feature = "std"), no_std)]
85+
#![no_std]
8686
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
8787
#![warn(missing_copy_implementations)]
8888
#![warn(missing_debug_implementations)]
@@ -116,9 +116,6 @@ mod util;
116116
pub use error::GuidFromStrError;
117117
pub use guid::{Guid, Variant};
118118

119-
#[cfg(feature = "std")]
120-
impl std::error::Error for GuidFromStrError {}
121-
122119
/// Create a [`Guid`] from a string at compile time.
123120
///
124121
/// # Examples

0 commit comments

Comments
 (0)
Please sign in to comment.