Skip to content

Commit b63b80e

Browse files
authored
Merge pull request #73 from Sh3Rm4n/into-from
Change Into trait to From trait
2 parents cfdb6fa + 1a603df commit b63b80e

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
@@ -53,21 +53,21 @@ impl U32Ext for u32 {
5353
}
5454
}
5555

56-
impl Into<Hertz> for KiloHertz {
57-
fn into(self) -> Hertz {
58-
Hertz(self.0 * 1_000)
56+
impl From<KiloHertz> for Hertz {
57+
fn from(val: KiloHertz) -> Self {
58+
Self(val.0 * 1_000)
5959
}
6060
}
6161

62-
impl Into<Hertz> for MegaHertz {
63-
fn into(self) -> Hertz {
64-
Hertz(self.0 * 1_000_000)
62+
impl From<MegaHertz> for Hertz {
63+
fn from(val: MegaHertz) -> Self {
64+
Self(val.0 * 1_000_000)
6565
}
6666
}
6767

68-
impl Into<KiloHertz> for MegaHertz {
69-
fn into(self) -> KiloHertz {
70-
KiloHertz(self.0 * 1_000)
68+
impl From<MegaHertz> for KiloHertz {
69+
fn from(val: MegaHertz) -> Self {
70+
Self(val.0 * 1_000)
7171
}
7272
}
7373

0 commit comments

Comments
 (0)