(&self)
| 102 | | Number::U8(_) |
| 103 | | Number::U16(_) |
| 104 | | Number::U32(_) |
| 105 | | Number::U64(_) |
| 106 | | Number::U128(_) |
| 107 | ) |
| 108 | } |
| 109 | |
| 110 | #[inline] |
| 111 | pub const fn is_float(&self) -> bool { |
| 112 | matches!(self, Number::F32(_) | Number::F64(_)) |
| 113 | } |
| 114 | |
| 115 | #[inline] |
| 116 | pub fn as_i64_lossy(&self) -> Option<i64> { |
| 117 | match *self { |
| 118 | Number::I8(v) => Some(v as i64), |
| 119 | Number::I16(v) => Some(v as i64), |
| 120 | Number::I32(v) => Some(v as i64), |
| 121 | Number::I64(v) => Some(v), |
| 122 | Number::I128(v) => i64::try_from(v.get()).ok(), |
no outgoing calls
no test coverage detected