We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
is_float
is_char
hir::Type
1 parent 9549753 commit fe82649Copy full SHA for fe82649
crates/hir/src/lib.rs
@@ -3210,6 +3210,14 @@ impl Type {
3210
matches!(self.ty.kind(Interner), TyKind::Scalar(Scalar::Uint(UintTy::Usize)))
3211
}
3212
3213
+ pub fn is_float(&self) -> bool {
3214
+ matches!(self.ty.kind(Interner), TyKind::Scalar(Scalar::Float(_)))
3215
+ }
3216
+
3217
+ pub fn is_char(&self) -> bool {
3218
+ matches!(self.ty.kind(Interner), TyKind::Scalar(Scalar::Char))
3219
3220
3221
pub fn is_int_or_uint(&self) -> bool {
3222
match self.ty.kind(Interner) {
3223
TyKind::Scalar(Scalar::Int(_) | Scalar::Uint(_)) => true,
0 commit comments