Skip to content

Commit d23582a

Browse files
api cleanup
1 parent 04c6d31 commit d23582a

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/error/datetime.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use crate::error::{Error, ErrorKind};
44

55
/// The kinds of errors that can occur when working with the [`DateTime`](crate::DateTime) type.
66
#[derive(Clone, Debug, ThisError)]
7+
#[non_exhaustive]
78
pub enum DateTimeErrorKind {
89
/// The `DateTime` could not be formatted.
910
#[error("{message}")]

src/error/oid.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use crate::error::{Error, ErrorKind};
66
/// The kinds of errors that can occur when working with the [`ObjectId`](crate::oid::ObjectId)
77
/// type.
88
#[derive(Clone, Debug, ThisError)]
9+
#[non_exhaustive]
910
pub enum ObjectIdErrorKind {
1011
/// An invalid character was found in the provided hex string. Valid characters are: `0...9`,
1112
/// `a...f`, or `A...F`.

src/error/uuid.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use crate::{
1111
#[non_exhaustive]
1212
pub enum UuidErrorKind {
1313
/// An invalid string was used to construct a UUID.
14-
#[error("Invalid UUID string: {message}")]
14+
#[error("{message}")]
1515
#[non_exhaustive]
1616
InvalidString {
1717
/// A message describing the error.
@@ -21,8 +21,8 @@ pub enum UuidErrorKind {
2121
/// The requested [`UuidRepresentation`] does not match the binary subtype of a [`Binary`]
2222
/// value.
2323
#[error(
24-
"UUID representation mismatch: expected binary subtype {expected_binary_subtype:?} for \
25-
representation {requested_representation:?}, got {actual_binary_subtype:?}"
24+
"expected binary subtype {expected_binary_subtype:?} for representation \
25+
{requested_representation:?}, got {actual_binary_subtype:?}"
2626
)]
2727
#[non_exhaustive]
2828
RepresentationMismatch {
@@ -37,7 +37,7 @@ pub enum UuidErrorKind {
3737
},
3838

3939
/// An invalid length of bytes was used to construct a UUID value.
40-
#[error("Invalid UUID length: expected 16 bytes, got {length}")]
40+
#[error("expected length of 16 bytes, got {length}")]
4141
#[non_exhaustive]
4242
InvalidLength {
4343
/// The actual length of the data.

0 commit comments

Comments
 (0)