File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -61,14 +61,16 @@ pub(super) async fn parse_input(
61
61
let to_mention: Vec < _ > = config
62
62
. paths
63
63
. iter ( )
64
- // Only mention matching paths.
65
- // Don't mention if only the author is in the list.
66
64
. filter ( |( path, MentionsPathConfig { cc, .. } ) | {
67
65
let path = Path :: new ( path) ;
68
- file_paths. iter ( ) . any ( |p| p. starts_with ( path) )
69
- && !cc
70
- . iter ( )
71
- . all ( |r| r. trim_start_matches ( '@' ) == & event. issue . user . login )
66
+ // Only mention matching paths.
67
+ let touches_relevant_files = file_paths. iter ( ) . any ( |p| p. starts_with ( path) ) ;
68
+ // Don't mention if only the author is in the list.
69
+ let pings_non_author = match & cc[ ..] {
70
+ [ only_cc] => only_cc. trim_start_matches ( '@' ) != & event. issue . user . login ,
71
+ _ => true ,
72
+ } ;
73
+ touches_relevant_files && pings_non_author
72
74
} )
73
75
. map ( |( key, _mention) | key. to_string ( ) )
74
76
. collect ( ) ;
You can’t perform that action at this time.
0 commit comments