Skip to content

Commit 69cd0ed

Browse files
committed
refactor(util-schemas): non_exhaustive for all error types
1 parent a6f5ca2 commit 69cd0ed

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

crates/cargo-util-schemas/src/core/package_id_spec.rs

+1
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ impl<'de> de::Deserialize<'de> for PackageIdSpec {
269269
}
270270

271271
/// Error parsing a [`PackageIdSpec`].
272+
#[non_exhaustive]
272273
#[derive(Debug, thiserror::Error)]
273274
pub enum PackageIdSpecError {
274275
#[error("unsupported source protocol: {0}")]

crates/cargo-util-schemas/src/core/partial_version.rs

+1
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ impl<'de> serde::Deserialize<'de> for PartialVersion {
160160
}
161161

162162
/// Error parsing a [`PartialVersion`].
163+
#[non_exhaustive]
163164
#[derive(Debug, thiserror::Error)]
164165
pub enum PartialVersionError {
165166
#[error("unexpected version requirement, expected a version like \"1.32\"")]

crates/cargo-util-schemas/src/restricted_names.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
type Result<T> = std::result::Result<T, NameValidationError>;
44

55
/// Error validating names in Cargo.
6+
#[non_exhaustive]
67
#[derive(Debug, thiserror::Error)]
78
pub enum NameValidationError {
89
#[error("{0} cannot be empty")]

0 commit comments

Comments
 (0)