New method len only for clippy warning?


#1

After vey busy days in work, i’ll continue to apply clippy. Clippy is warning that:

warning: item `backend::small_string::SmallString` has a public `len` method but no corresponding `is_empty` method                                                     
	--> src\backend.rs:1005:5                                                                                                                                           
	 |                                                                                                                                                                  
1005 | /     impl SmallString {                                                                                                                                         
1006 | |         pub fn len(&self) -> usize {                                                                                                                           
1007 | |             self.len as usize                                                                                                                                  
1008 | |         }                                                                                                                                                      
...    |                                                                                                                                                                
1037 | |         }                                                                                                                                                      
1038 | |     }                                                                                                                                                          
	 | |_____^                                                                                                                                                          
	 |                                                                                                                                                                  
	 = note: #[warn(len_without_is_empty)] on by default                                                                                                                
	 = help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#len_without_is_empty                                                         

There is consensus about this warning in rust community? Adding a method only to put a smile in clippy is ok?


#2

Seems like a somewhat opinionated lint :face_with_raised_eyebrow: But the documentation does have a point. I think you tweak the lints through a settings file, if you want to ignore it.