@@ -325,7 +325,7 @@ impl Iterator for Paths {
325
325
// failing to fill the buffer is an iteration error construction of the
326
326
// iterator (i.e. glob()) only fails if it fails to compile the Pattern
327
327
if let Some ( scope) = self . scope . take ( ) {
328
- if self . dir_patterns . len ( ) > 0 {
328
+ if ! self . dir_patterns . is_empty ( ) {
329
329
// Shouldn't happen, but we're using -1 as a special index.
330
330
assert ! ( self . dir_patterns. len( ) < !0 as usize ) ;
331
331
@@ -790,7 +790,7 @@ fn fill_todo(todo: &mut Vec<Result<(PathBuf, usize), GlobError>>,
790
790
// convert a pattern that's just many Char(_) to a string
791
791
fn pattern_as_str ( pattern : & Pattern ) -> Option < String > {
792
792
let mut s = String :: new ( ) ;
793
- for token in pattern. tokens . iter ( ) {
793
+ for token in & pattern. tokens {
794
794
match * token {
795
795
Char ( c) => s. push ( c) ,
796
796
_ => return None ,
@@ -854,8 +854,8 @@ fn fill_todo(todo: &mut Vec<Result<(PathBuf, usize), GlobError>>,
854
854
// requires that the pattern has a leading dot, even if the
855
855
// `MatchOptions` field `require_literal_leading_dot` is not
856
856
// set.
857
- if pattern. tokens . len ( ) > 0 && pattern. tokens [ 0 ] == Char ( '.' ) {
858
- for & special in [ "." , ".." ] . iter ( ) {
857
+ if ! pattern. tokens . is_empty ( ) && pattern. tokens [ 0 ] == Char ( '.' ) {
858
+ for & special in & [ "." , ".." ] {
859
859
if pattern. matches_with ( special, options) {
860
860
add ( todo, path. join ( special) ) ;
861
861
}
0 commit comments