Skip to content

Commit 3880308

Browse files
committed
fix: Rename Label::ERROR.text().title() with Label::ERROR.with_name().title()
1 parent 504b54a commit 3880308

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

examples/custom_error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub static C: u32 = 0 - 1;
1717
"#;
1818
let message = &[Group::with_title(
1919
Level::ERROR
20-
.text(Some("error: internal compiler error"))
20+
.with_name(Some("error: internal compiler error"))
2121
.title("could not evaluate static initializer")
2222
.id("E0080"),
2323
)

examples/custom_level.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ fn main() {
5252
),
5353
Group::with_title(
5454
Level::HELP
55-
.text(Some("suggestion"))
55+
.with_name(Some("suggestion"))
5656
.title("use `break` on its own without a value inside this `while` loop"),
5757
)
5858
.element(

src/level.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ impl<'a> Level<'a> {
5050
pub const NOTE: Level<'a> = NOTE;
5151
pub const HELP: Level<'a> = HELP;
5252

53-
/// Replace the text describing this [`Level`]
53+
/// Replace the name describing this [`Level`]
5454
///
5555
/// <div class="warning">
5656
///
@@ -59,7 +59,7 @@ impl<'a> Level<'a> {
5959
/// not allowed to be passed to this function.
6060
///
6161
/// </div>
62-
pub fn text(self, text: impl Into<OptionCow<'a>>) -> Level<'a> {
62+
pub fn with_name(self, text: impl Into<OptionCow<'a>>) -> Level<'a> {
6363
Level {
6464
name: Some(text.into().0),
6565
level: self.level,

tests/formatter.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2397,7 +2397,7 @@ fn secondary_title_no_level_text() {
23972397
)
23982398
.element(
23992399
Level::NOTE
2400-
.text(None::<&str>)
2400+
.with_name(None::<&str>)
24012401
.title("expected reference `&str`\nfound reference `&'static [u8; 0]`"),
24022402
),
24032403
];
@@ -2442,7 +2442,7 @@ fn secondary_title_custom_level_text() {
24422442
)
24432443
.element(
24442444
Level::NOTE
2445-
.text(Some("custom"))
2445+
.with_name(Some("custom"))
24462446
.title("expected reference `&str`\nfound reference `&'static [u8; 0]`"),
24472447
),
24482448
];
@@ -2515,7 +2515,7 @@ fn main() {
25152515
),
25162516
Group::with_title(
25172517
Level::HELP
2518-
.text(Some("suggestion"))
2518+
.with_name(Some("suggestion"))
25192519
.title("use `break` on its own without a value inside this `while` loop")
25202520
.id("S0123"),
25212521
)

0 commit comments

Comments
 (0)