Skip to content

Commit 403ba9b

Browse files
kenton-rclaude
andcommitted
Fix clippy doc warnings in line-break oracle docs
Wrap LB rule names (LB7, LB9, LB11, LB12a, LB13, LB21, LB22) in backticks to satisfy clippy::doc_markdown, and dedent the LB21 continuation lines to satisfy clippy::doc_overindented_list_items. No code changes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 970f7a2 commit 403ba9b

File tree

1 file changed

+25
-28
lines changed

1 file changed

+25
-28
lines changed

components/segmenter/src/line.rs

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,15 @@ const ZWJ: u8 = 54;
137137
/// `× class` unconditionally (or unconditionally in all contexts reachable
138138
/// from SA in practice):
139139
///
140-
/// * **LB7**: `× SP` — never break before a space.
141-
/// * **LB9**: `× CM`, `× ZWJ` — combining marks attach to the preceding char.
142-
/// * **LB11**: `× WJ` — word-joiner is glue.
143-
/// * **LB12a**:`× GL` — non-breaking glue.
144-
/// * **LB13**: `× CL`, `× CP`, `× EX`, `× IS`, `× SY`.
145-
/// * **LB21**: `× BA`, `× HY`, `× NS` — no break before these after the
146-
/// previous non-space char (SA never introduces a space on its
147-
/// right, so this simplifies to unconditional `×`).
148-
/// * **LB22**: `× IN`.
140+
/// * **`LB7`**: `× SP` — never break before a space.
141+
/// * **`LB9`**: `× CM`, `× ZWJ` — combining marks attach to the preceding char.
142+
/// * **`LB11`**: `× WJ` — word-joiner is glue.
143+
/// * **`LB12a`**:`× GL` — non-breaking glue.
144+
/// * **`LB13`**: `× CL`, `× CP`, `× EX`, `× IS`, `× SY`.
145+
/// * **`LB21`**: `× BA`, `× HY`, `× NS` — no break before these after the
146+
/// previous non-space char (SA never introduces a space on its
147+
/// right, so this simplifies to unconditional `×`).
148+
/// * **`LB22`**: `× IN`.
149149
///
150150
/// Classes intentionally **not** included here either allow a break
151151
/// (LB18 `SP ÷`, etc.), require surrounding context that our SA-adjacent
@@ -1329,17 +1329,15 @@ where
13291329
// `ResolvedLineBreakOptions` derives `Copy`).
13301330
let data = iter.data;
13311331
let options = iter.options;
1332-
let breaks = iter.complex.complex_language_line_breaks_str(
1333-
&s,
1334-
next_ext_char,
1335-
|c| {
1332+
let breaks = iter
1333+
.complex
1334+
.complex_language_line_breaks_str(&s, next_ext_char, |c| {
13361335
lb_class_forbids_break_before(data.get_linebreak_property_utf32_with_rule(
13371336
c as u32,
13381337
options.strictness,
13391338
options.word_option,
13401339
))
1341-
},
1342-
);
1340+
});
13431341
iter.result_cache = breaks;
13441342
let first_pos = *iter.result_cache.first()?;
13451343
let mut i = left_codepoint.len_utf8();
@@ -1433,17 +1431,16 @@ impl LineBreakType for Utf16 {
14331431
// EX, IS, SY, WJ, IN, NS, HY, ZWJ, CM) are BMP, so a single u16
14341432
// lookup is faithful for our purposes.
14351433
let next_ext_code_unit = next_ext_cp.and_then(|c| u16::try_from(c).ok());
1436-
let breaks = iterator.complex.complex_language_line_breaks_utf16(
1437-
&s,
1438-
next_ext_code_unit,
1439-
|c| {
1440-
lb_class_forbids_break_before(data.get_linebreak_property_utf32_with_rule(
1441-
c as u32,
1442-
options.strictness,
1443-
options.word_option,
1444-
))
1445-
},
1446-
);
1434+
let breaks =
1435+
iterator
1436+
.complex
1437+
.complex_language_line_breaks_utf16(&s, next_ext_code_unit, |c| {
1438+
lb_class_forbids_break_before(data.get_linebreak_property_utf32_with_rule(
1439+
c as u32,
1440+
options.strictness,
1441+
options.word_option,
1442+
))
1443+
});
14471444
iterator.result_cache = breaks;
14481445
// result_cache vector is utf-16 index that is in BMP.
14491446
let first_pos = *iterator.result_cache.first()?;
@@ -1993,8 +1990,8 @@ mod tests {
19931990
/// `forbids_break_before` predicate for every terminal SA boundary,
19941991
/// so all of the following must be handled uniformly:
19951992
///
1996-
/// - U+00A0 NO-BREAK SPACE → GL (LB12a × GL)
1997-
/// - U+3000 IDEOGRAPHIC SP → BA (LB21 × BA)
1993+
/// - U+00A0 NO-BREAK SPACE → GL (`LB12a` × GL)
1994+
/// - U+3000 IDEOGRAPHIC SP → BA (`LB21` × BA)
19981995
/// - U+2009 THIN SPACE → BA
19991996
/// - U+0009 TAB → BA
20001997
#[test]

0 commit comments

Comments
 (0)