@@ -229,10 +229,9 @@ fn kill_linkage_instructions(
229229 . retain ( |f| !rewrite_rules. contains_key ( & f. def_id ( ) . unwrap ( ) ) ) ;
230230
231231 // drop imported variables
232- module. types_global_values . retain ( |v| {
233- v. result_id
234- . map_or ( true , |v| !rewrite_rules. contains_key ( & v) )
235- } ) ;
232+ module
233+ . types_global_values
234+ . retain ( |v| v. result_id . is_none_or ( |v| !rewrite_rules. contains_key ( & v) ) ) ;
236235
237236 // NOTE(eddyb) `Options`'s `keep_link_export`s field requests that `Export`s
238237 // are left in (primarily for unit testing - see also its doc comment).
@@ -264,21 +263,21 @@ fn import_kill_annotations_and_debug(
264263) {
265264 module. annotations . retain ( |inst| {
266265 inst. operands . is_empty ( )
267- || inst. operands [ 0 ] . id_ref_any ( ) . map_or ( true , |id| {
266+ || inst. operands [ 0 ] . id_ref_any ( ) . is_none_or ( |id| {
268267 !rewrite_rules. contains_key ( & id) && !killed_parameters. contains ( & id)
269268 } )
270269 } ) ;
271270 module. debug_names . retain ( |inst| {
272271 inst. operands . is_empty ( )
273- || inst. operands [ 0 ] . id_ref_any ( ) . map_or ( true , |id| {
272+ || inst. operands [ 0 ] . id_ref_any ( ) . is_none_or ( |id| {
274273 !rewrite_rules. contains_key ( & id) && !killed_parameters. contains ( & id)
275274 } )
276275 } ) ;
277276 // need to remove OpGroupDecorate members that mention this id
278277 for inst in & mut module. annotations {
279278 if inst. class . opcode == Op :: GroupDecorate {
280279 inst. operands . retain ( |op| {
281- op. id_ref_any ( ) . map_or ( true , |id| {
280+ op. id_ref_any ( ) . is_none_or ( |id| {
282281 !rewrite_rules. contains_key ( & id) && !killed_parameters. contains ( & id)
283282 } )
284283 } ) ;
0 commit comments