Skip to content

Commit 301bc1a

Browse files
committed
feat: rename traits to ValidFrom and ValidInto
1 parent d0da788 commit 301bc1a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,24 @@ pub use cause::*;
66
pub use valid::*;
77

88
/// Moral equivalent of TryFrom for validation purposes
9-
pub trait ValidateFrom<T>: Sized {
9+
pub trait ValidFrom<T>: Sized {
1010
type Error;
1111
type Trace;
12-
fn validate_from(a: T) -> Valid<Self, Self::Error, Self::Trace>;
12+
fn valid_from(a: T) -> Valid<Self, Self::Error, Self::Trace>;
1313
}
1414

1515
/// Moral equivalent of TryInto for validation purposes
16-
pub trait ValidateInto<T> {
16+
pub trait ValidInto<T> {
1717
type Error;
1818
type Trace;
19-
fn validate_into(self) -> Valid<T, Self::Error, Self::Trace>;
19+
fn valid_into(self) -> Valid<T, Self::Error, Self::Trace>;
2020
}
2121

2222
/// A blanket implementation for ValidateInto
23-
impl<S, T: ValidateFrom<S>> ValidateInto<T> for S {
23+
impl<S, T: ValidFrom<S>> ValidInto<T> for S {
2424
type Error = T::Error;
2525
type Trace = T::Trace;
26-
fn validate_into(self) -> Valid<T, Self::Error, Self::Trace> {
27-
T::validate_from(self)
26+
fn valid_into(self) -> Valid<T, Self::Error, Self::Trace> {
27+
T::valid_from(self)
2828
}
2929
}

0 commit comments

Comments
 (0)