/rust/registry/src/index.crates.io-1949cf8c6b5b557f/num-traits-0.2.17/src/macros.rs
Line | Count | Source |
1 | | // not all are used in all features configurations |
2 | | #![allow(unused)] |
3 | | |
4 | | /// Forward a method to an inherent method or a base trait method. |
5 | | macro_rules! forward { |
6 | | ($( Self :: $method:ident ( self $( , $arg:ident : $ty:ty )* ) -> $ret:ty ; )*) |
7 | | => {$( |
8 | | #[inline] |
9 | 0 | fn $method(self $( , $arg : $ty )* ) -> $ret { |
10 | 0 | Self::$method(self $( , $arg )* ) |
11 | 0 | } Unexecuted instantiation: <f32 as num_traits::float::FloatCore>::is_sign_negative Unexecuted instantiation: <f32 as num_traits::float::FloatCore>::abs Unexecuted instantiation: <f32 as num_traits::float::FloatCore>::recip Unexecuted instantiation: <f32 as num_traits::float::FloatCore>::is_nan Unexecuted instantiation: <f32 as num_traits::float::FloatCore>::is_finite Unexecuted instantiation: <f64 as num_traits::float::FloatCore>::is_sign_negative Unexecuted instantiation: <f64 as num_traits::float::FloatCore>::abs Unexecuted instantiation: <f64 as num_traits::float::FloatCore>::recip Unexecuted instantiation: <f64 as num_traits::float::FloatCore>::is_nan Unexecuted instantiation: <f64 as num_traits::float::FloatCore>::is_finite |
12 | | )*}; |
13 | | ($( $base:ident :: $method:ident ( self $( , $arg:ident : $ty:ty )* ) -> $ret:ty ; )*) |
14 | | => {$( |
15 | | #[inline] |
16 | | fn $method(self $( , $arg : $ty )* ) -> $ret { |
17 | | <Self as $base>::$method(self $( , $arg )* ) |
18 | | } |
19 | | )*}; |
20 | | ($( $base:ident :: $method:ident ( $( $arg:ident : $ty:ty ),* ) -> $ret:ty ; )*) |
21 | | => {$( |
22 | | #[inline] |
23 | | fn $method( $( $arg : $ty ),* ) -> $ret { |
24 | | <Self as $base>::$method( $( $arg ),* ) |
25 | | } |
26 | | )*}; |
27 | | ($( $imp:path as $method:ident ( self $( , $arg:ident : $ty:ty )* ) -> $ret:ty ; )*) |
28 | | => {$( |
29 | | #[inline] |
30 | | fn $method(self $( , $arg : $ty )* ) -> $ret { |
31 | | $imp(self $( , $arg )* ) |
32 | | } |
33 | | )*}; |
34 | | } |
35 | | |
36 | | macro_rules! constant { |
37 | | ($( $method:ident () -> $ret:expr ; )*) |
38 | | => {$( |
39 | | #[inline] |
40 | | fn $method() -> Self { |
41 | | $ret |
42 | | } |
43 | | )*}; |
44 | | } |