mirror of
				https://github.com/rust-lang/rust-analyzer.git
				synced 2025-11-03 13:13:18 +00:00 
			
		
		
		
	feat: add is_float & is_char to hir::Type
				
					
				
			This commit is contained in:
		
							parent
							
								
									9549753352
								
							
						
					
					
						commit
						fe82649e77
					
				@ -3210,6 +3210,14 @@ impl Type {
 | 
				
			|||||||
        matches!(self.ty.kind(Interner), TyKind::Scalar(Scalar::Uint(UintTy::Usize)))
 | 
					        matches!(self.ty.kind(Interner), TyKind::Scalar(Scalar::Uint(UintTy::Usize)))
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    pub fn is_float(&self) -> bool {
 | 
				
			||||||
 | 
					        matches!(self.ty.kind(Interner), TyKind::Scalar(Scalar::Float(_)))
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    pub fn is_char(&self) -> bool {
 | 
				
			||||||
 | 
					        matches!(self.ty.kind(Interner), TyKind::Scalar(Scalar::Char))
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    pub fn is_int_or_uint(&self) -> bool {
 | 
					    pub fn is_int_or_uint(&self) -> bool {
 | 
				
			||||||
        match self.ty.kind(Interner) {
 | 
					        match self.ty.kind(Interner) {
 | 
				
			||||||
            TyKind::Scalar(Scalar::Int(_) | Scalar::Uint(_)) => true,
 | 
					            TyKind::Scalar(Scalar::Int(_) | Scalar::Uint(_)) => true,
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user