@@ -384,7 +384,7 @@ fn find_candidate(backtrack_stack: &mut Vec<BacktrackFrame>,
384384 return Some ( candidate)
385385 }
386386 }
387- return None
387+ None
388388}
389389
390390#[ allow( deprecated) ] // connect => join in 1.3
@@ -453,7 +453,7 @@ fn activation_error(cx: &Context,
453453 candidates. sort_by ( |a, b| {
454454 b. version ( ) . cmp ( a. version ( ) )
455455 } ) ;
456- if candidates. len ( ) > 0 {
456+ if ! candidates. is_empty ( ) {
457457 msg. push_str ( "\n versions found: " ) ;
458458 for ( i, c) in candidates. iter ( ) . take ( 3 ) . enumerate ( ) {
459459 if i != 0 { msg. push_str ( ", " ) ; }
@@ -469,7 +469,7 @@ fn activation_error(cx: &Context,
469469 // update`. In this case try to print a helpful error!
470470 if dep. source_id ( ) . is_path ( ) &&
471471 dep. version_req ( ) . to_string ( ) . starts_with ( "=" ) &&
472- candidates. len ( ) > 0 {
472+ ! candidates. is_empty ( ) {
473473 msg. push_str ( "\n consider running `cargo update` to update \
474474 a path dependency's locked version") ;
475475
@@ -607,7 +607,7 @@ impl Context {
607607 ( !use_default || prev. contains ( "default" ) ||
608608 !has_default_feature)
609609 }
610- None => features. len ( ) == 0 && ( !use_default || !has_default_feature)
610+ None => features. is_empty ( ) && ( !use_default || !has_default_feature)
611611 }
612612 }
613613
@@ -686,18 +686,18 @@ impl Context {
686686 // they should have all been weeded out by the above iteration. Any
687687 // remaining features are bugs in that the package does not actually
688688 // have those features.
689- if feature_deps. len ( ) > 0 {
689+ if ! feature_deps. is_empty ( ) {
690690 let unknown = feature_deps. keys ( ) . map ( |s| & s[ ..] )
691691 . collect :: < Vec < & str > > ( ) ;
692- if unknown. len ( ) > 0 {
692+ if ! unknown. is_empty ( ) {
693693 let features = unknown. connect ( ", " ) ;
694694 bail ! ( "Package `{}` does not have these features: `{}`" ,
695695 parent. package_id( ) , features)
696696 }
697697 }
698698
699699 // Record what list of features is active for this package.
700- if used_features. len ( ) > 0 {
700+ if ! used_features. is_empty ( ) {
701701 let pkgid = parent. package_id ( ) ;
702702 self . resolve . features . entry ( pkgid. clone ( ) )
703703 . or_insert ( HashSet :: new ( ) )
0 commit comments