Skip to content

Commit 7a94f04

Browse files
authored
Merge pull request #194 from dbrgn/hertz-into-from
Hertz: Replace Into impls with From impls
2 parents 854526e + 06b69af commit 7a94f04

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/time.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -141,21 +141,21 @@ impl U32Ext for u32 {
141141
}
142142
}
143143

144-
impl Into<Hertz> for KiloHertz {
145-
fn into(self) -> Hertz {
146-
Hertz(self.0 * 1_000)
144+
impl From<KiloHertz> for Hertz {
145+
fn from(val: KiloHertz) -> Self {
146+
Self(val.0 * 1_000)
147147
}
148148
}
149149

150-
impl Into<Hertz> for MegaHertz {
151-
fn into(self) -> Hertz {
152-
Hertz(self.0 * 1_000_000)
150+
impl From<MegaHertz> for Hertz {
151+
fn from(val: MegaHertz) -> Self {
152+
Self(val.0 * 1_000_000)
153153
}
154154
}
155155

156-
impl Into<KiloHertz> for MegaHertz {
157-
fn into(self) -> KiloHertz {
158-
KiloHertz(self.0 * 1_000)
156+
impl From<MegaHertz> for KiloHertz {
157+
fn from(val: MegaHertz) -> Self {
158+
Self(val.0 * 1_000)
159159
}
160160
}
161161

0 commit comments

Comments
 (0)