Comparing changes

Choose two branches to see what's changed or to start a new pull request.

base: runtime-hello-parity
compare: ci-submodule-refs-20260416
Create pull request
Able to merge. These branches can be automatically merged.
1 commit 1 file changed 1 contributor

Commits on ci-submodule-refs-20260416

src/macho/tbd_yaml.rsmodified
@@ -198,15 +198,16 @@ fn strip_eol_comment(s: &mut String) {
198198
                 i += 2;
199199
                 continue;
200200
             }
201
-            b'#' if !in_single && !in_double => {
202
-                // A comment must be preceded by whitespace or be at BOL.
203
-                if i == 0 || bytes[i - 1] == b' ' || bytes[i - 1] == b'\t' {
204
-                    s.truncate(i);
205
-                    // Trim trailing whitespace left by the strip.
206
-                    let trimmed_len = s.trim_end().len();
207
-                    s.truncate(trimmed_len);
208
-                    return;
209
-                }
201
+            b'#'
202
+                if !in_single
203
+                    && !in_double
204
+                    && (i == 0 || bytes[i - 1] == b' ' || bytes[i - 1] == b'\t') =>
205
+            {
206
+                s.truncate(i);
207
+                // Trim trailing whitespace left by the strip.
208
+                let trimmed_len = s.trim_end().len();
209
+                s.truncate(trimmed_len);
210
+                return;
210211
             }
211212
             _ => {}
212213
         }
@@ -426,11 +427,15 @@ fn find_top_level_mapping_colon(s: &str) -> Option<usize> {
426427
             }
427428
             b'[' | b'{' if !in_single && !in_double => depth += 1,
428429
             b']' | b'}' if !in_single && !in_double => depth -= 1,
429
-            b':' if !in_single && !in_double && depth == 0 => {
430
-                // Must be followed by whitespace or end of line per YAML rules.
431
-                if i + 1 == bytes.len() || bytes[i + 1] == b' ' || bytes[i + 1] == b'\t' {
432
-                    return Some(i);
433
-                }
430
+            b':'
431
+                if !in_single
432
+                    && !in_double
433
+                    && depth == 0
434
+                    && (i + 1 == bytes.len()
435
+                        || bytes[i + 1] == b' '
436
+                        || bytes[i + 1] == b'\t') =>
437
+            {
438
+                return Some(i);
434439
             }
435440
             _ => {}
436441
         }