impl AsRef<Self> for primitives
This commit is contained in:
parent
d541e8822f
commit
3d43653d9f
|
@ -551,6 +551,12 @@ macro_rules! construct_uint {
|
||||||
#[derive(Copy, Clone, Eq, PartialEq, Hash)]
|
#[derive(Copy, Clone, Eq, PartialEq, Hash)]
|
||||||
pub struct $name(pub [u64; $n_words]);
|
pub struct $name(pub [u64; $n_words]);
|
||||||
|
|
||||||
|
impl AsRef<$name> for $name {
|
||||||
|
fn as_ref(&self) -> &$name {
|
||||||
|
&self
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl $name {
|
impl $name {
|
||||||
/// Convert from a decimal string.
|
/// Convert from a decimal string.
|
||||||
pub fn from_dec_str(value: &str) -> Result<Self, $crate::FromDecStrErr> {
|
pub fn from_dec_str(value: &str) -> Result<Self, $crate::FromDecStrErr> {
|
||||||
|
|
Loading…
Reference in New Issue