File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -344,6 +344,7 @@ fn source_contains_l10n_markers(source: &[u8]) -> bool {
344344 || bytes_contains ( source, b"NSLocalizedString" )
345345 || bytes_contains ( source, b"LocalizedStringKey" )
346346 || bytes_contains ( source, b"Text(\" " )
347+ || bytes_contains ( source, b"Text(." )
347348 || bytes_contains ( source, b"Localizable" )
348349}
349350
@@ -800,6 +801,9 @@ mod marker_tests {
800801 #[ test]
801802 fn localization_and_asset_markers_still_match_common_cases ( ) {
802803 assert ! ( source_contains_l10n_markers( br#"Text("hello")"# ) ) ;
804+ assert ! ( source_contains_l10n_markers(
805+ br#"Text(.accountForgetPassword)"#
806+ ) ) ;
803807 assert ! ( source_contains_l10n_markers(
804808 br#"NSLocalizedString("hello", comment: "")"#
805809 ) ) ;
Original file line number Diff line number Diff line change @@ -319,18 +319,21 @@ fn choose_preferred_origin<'a>(
319319 current : & ' a OriginPath ,
320320 candidate : & ' a OriginPath ,
321321) -> & ' a OriginPath {
322- origin_specificity_rank ( candidate)
322+ let candidate_ordering = origin_specificity_rank ( candidate)
323323 . cmp ( & origin_specificity_rank ( current) )
324324 . then_with ( || {
325325 candidate
326326 . confidence
327327 . partial_cmp ( & current. confidence )
328328 . unwrap_or ( std:: cmp:: Ordering :: Equal )
329329 } )
330- . then_with ( || current. api . name . cmp ( & candidate. api . name ) . reverse ( ) )
331- . is_gt ( )
332- . then_some ( candidate)
333- . unwrap_or ( current)
330+ . then_with ( || current. api . name . cmp ( & candidate. api . name ) . reverse ( ) ) ;
331+
332+ if candidate_ordering. is_gt ( ) {
333+ candidate
334+ } else {
335+ current
336+ }
334337}
335338
336339fn merge_equivalent_origins ( origins : Vec < OriginPath > ) -> Vec < OriginPath > {
@@ -641,14 +644,13 @@ fn notes_for(
641644 . iter ( )
642645 . rev ( )
643646 . find ( |node| is_origin_terminal ( node) )
647+ && let Some ( kind) = terminal_kind ( terminal_node)
644648 {
645- if let Some ( kind) = terminal_kind ( terminal_node) {
646- notes. push ( format ! (
647- "reached {} terminal {}" ,
648- terminal_kind_to_string( & kind) ,
649- terminal_node. name
650- ) ) ;
651- }
649+ notes. push ( format ! (
650+ "reached {} terminal {}" ,
651+ terminal_kind_to_string( & kind) ,
652+ terminal_node. name
653+ ) ) ;
652654 }
653655 if let Some ( candidate) = field_candidates. first ( ) {
654656 notes. push ( format ! ( "candidate field path {}" , candidate) ) ;
You can’t perform that action at this time.
0 commit comments