@@ -718,7 +718,7 @@ impl schema::TomlManifest {
718
718
let lints = me
719
719
. lints
720
720
. clone ( )
721
- . map ( |mw| mw . inherit_with ( || inherit ( ) ?. lints ( ) ) )
721
+ . map ( |mw| lints_inherit_with ( mw , || inherit ( ) ?. lints ( ) ) )
722
722
. transpose ( ) ?;
723
723
let lints = verify_lints ( lints) ?;
724
724
let default = schema:: TomlLints :: default ( ) ;
@@ -1573,21 +1573,19 @@ fn field_inherit_with<'a, T>(
1573
1573
}
1574
1574
}
1575
1575
1576
- impl schema:: InheritableLints {
1577
- fn inherit_with < ' a > (
1578
- self ,
1579
- get_ws_inheritable : impl FnOnce ( ) -> CargoResult < schema:: TomlLints > ,
1580
- ) -> CargoResult < schema:: TomlLints > {
1581
- if self . workspace {
1582
- if !self . lints . is_empty ( ) {
1583
- anyhow:: bail!( "cannot override `workspace.lints` in `lints`, either remove the overrides or `lints.workspace = true` and manually specify the lints" ) ;
1584
- }
1585
- get_ws_inheritable ( ) . with_context ( || {
1586
- "error inheriting `lints` from workspace root manifest's `workspace.lints`"
1587
- } )
1588
- } else {
1589
- Ok ( self . lints )
1576
+ fn lints_inherit_with (
1577
+ lints : schema:: InheritableLints ,
1578
+ get_ws_inheritable : impl FnOnce ( ) -> CargoResult < schema:: TomlLints > ,
1579
+ ) -> CargoResult < schema:: TomlLints > {
1580
+ if lints. workspace {
1581
+ if !lints. lints . is_empty ( ) {
1582
+ anyhow:: bail!( "cannot override `workspace.lints` in `lints`, either remove the overrides or `lints.workspace = true` and manually specify the lints" ) ;
1590
1583
}
1584
+ get_ws_inheritable ( ) . with_context ( || {
1585
+ "error inheriting `lints` from workspace root manifest's `workspace.lints`"
1586
+ } )
1587
+ } else {
1588
+ Ok ( lints. lints )
1591
1589
}
1592
1590
}
1593
1591
0 commit comments