@@ -519,12 +519,11 @@ pub fn to_real_manifest(
519
519
520
520
let workspace_config = match ( original_toml. workspace . as_ref ( ) , package. workspace . as_ref ( ) ) {
521
521
( Some ( toml_config) , None ) => {
522
- let lints = toml_config. lints . clone ( ) ;
523
- let lints = verify_lints ( lints) ?;
522
+ verify_lints ( toml_config. lints . as_ref ( ) ) ?;
524
523
let inheritable = InheritableFields {
525
524
package : toml_config. package . clone ( ) ,
526
525
dependencies : toml_config. dependencies . clone ( ) ,
527
- lints,
526
+ lints : toml_config . lints . clone ( ) ,
528
527
_ws_root : package_root. to_path_buf ( ) ,
529
528
} ;
530
529
if let Some ( ws_deps) = & inheritable. dependencies {
@@ -867,7 +866,7 @@ pub fn to_real_manifest(
867
866
. clone ( )
868
867
. map ( |mw| lints_inherit_with ( mw, || inherit ( ) ?. lints ( ) ) )
869
868
. transpose ( ) ?;
870
- let lints = verify_lints ( lints) ?;
869
+ verify_lints ( lints. as_ref ( ) ) ?;
871
870
let default = manifest:: TomlLints :: default ( ) ;
872
871
let rustflags = lints_to_rustflags ( lints. as_ref ( ) . unwrap_or ( & default) ) ;
873
872
@@ -1337,12 +1336,11 @@ fn to_virtual_manifest(
1337
1336
. transpose ( ) ?;
1338
1337
let workspace_config = match original_toml. workspace {
1339
1338
Some ( ref toml_config) => {
1340
- let lints = toml_config. lints . clone ( ) ;
1341
- let lints = verify_lints ( lints) ?;
1339
+ verify_lints ( toml_config. lints . as_ref ( ) ) ?;
1342
1340
let inheritable = InheritableFields {
1343
1341
package : toml_config. package . clone ( ) ,
1344
1342
dependencies : toml_config. dependencies . clone ( ) ,
1345
- lints,
1343
+ lints : toml_config . lints . clone ( ) ,
1346
1344
_ws_root : root. to_path_buf ( ) ,
1347
1345
} ;
1348
1346
let ws_root_config = WorkspaceRootConfig :: new (
@@ -1476,12 +1474,12 @@ struct ManifestContext<'a, 'b> {
1476
1474
features : & ' a Features ,
1477
1475
}
1478
1476
1479
- fn verify_lints ( lints : Option < manifest:: TomlLints > ) -> CargoResult < Option < manifest :: TomlLints > > {
1477
+ fn verify_lints ( lints : Option < & manifest:: TomlLints > ) -> CargoResult < ( ) > {
1480
1478
let Some ( lints) = lints else {
1481
- return Ok ( None ) ;
1479
+ return Ok ( ( ) ) ;
1482
1480
} ;
1483
1481
1484
- for ( tool, lints) in & lints {
1482
+ for ( tool, lints) in lints {
1485
1483
let supported = [ "rust" , "clippy" , "rustdoc" ] ;
1486
1484
if !supported. contains ( & tool. as_str ( ) ) {
1487
1485
let supported = supported. join ( ", " ) ;
@@ -1504,7 +1502,7 @@ fn verify_lints(lints: Option<manifest::TomlLints>) -> CargoResult<Option<manife
1504
1502
}
1505
1503
}
1506
1504
1507
- Ok ( Some ( lints ) )
1505
+ Ok ( ( ) )
1508
1506
}
1509
1507
1510
1508
fn lints_to_rustflags ( lints : & manifest:: TomlLints ) -> Vec < String > {
0 commit comments