-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7dbbacc
commit a2cadfa
Showing
8 changed files
with
88 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,22 @@ | ||
use crate::Hybrid; | ||
use crate::LinkType; | ||
use funty::Integral; | ||
use std::ops::Sub; | ||
|
||
#[derive(Default)] | ||
pub struct AddrToRaw; | ||
|
||
impl AddrToRaw { | ||
pub fn new() -> Self { | ||
Self | ||
} | ||
|
||
pub fn convert<T: LinkType>(&self, source: T) -> T { | ||
Hybrid::new(source).as_inner() | ||
pub const fn convert<T: LinkType + ~const Integral + ~const Sub>(&self, source: T) -> T { | ||
Hybrid::external(source).as_inner() | ||
} | ||
} | ||
|
||
#[derive(Default)] | ||
pub struct RawToAddr; | ||
|
||
impl RawToAddr { | ||
pub fn new() -> Self { | ||
Self | ||
} | ||
|
||
pub fn convert<T: LinkType>(&self, source: T) -> T { | ||
Hybrid::new(source).abs() | ||
pub const fn convert<T: LinkType + ~const Integral + ~const Sub>(&self, source: T) -> T { | ||
Hybrid::external(source).abs() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters