Unverified Commit c059491a authored by david-perez's avatar david-perez Committed by GitHub
Browse files

Fix docs for `aws_smithy_types::Number` converters (#1252)

parent 107194f1
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -89,8 +89,10 @@ pub enum Number {
}

macro_rules! to_num_fn {
    ($name:ident, $typ:ident) => {
        /// Converts to a `$typ`. This conversion may be lossy.
    ($name:ident, $typ:ident, $styp:expr) => {
        #[doc = "Converts to a `"]
        #[doc = $styp]
        #[doc = "`. This conversion may be lossy."]
        pub fn $name(self) -> $typ {
            match self {
                Number::PosInt(val) => val as $typ,
@@ -99,6 +101,10 @@ macro_rules! to_num_fn {
            }
        }
    };

    ($name:ident, $typ:ident) => {
        to_num_fn!($name, $typ, stringify!($typ));
    };
}

impl Number {