Skip to content

Commit 7ec47b1

Browse files
committed
docs: Switch all messages to Level::message
1 parent ea73333 commit 7ec47b1

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

examples/elide_header.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def foobar(door, bar={}):
1414
.fold(false)
1515
.annotation(AnnotationKind::Primary.span(56..58).label("B006")),
1616
)
17-
.element(Level::HELP.title("Replace with `None`; initialize within function"))];
17+
.element(Level::HELP.message("Replace with `None`; initialize within function"))];
1818

1919
let renderer = Renderer::styled();
2020
anstream::println!("{}", renderer.render(message));

tests/formatter.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ error:
199199
#[test]
200200
fn test_format_footer_title() {
201201
let input = &[Group::with_title(Level::ERROR.title(""))
202-
.element(Level::ERROR.title("This __is__ a title"))];
202+
.element(Level::ERROR.message("This __is__ a title"))];
203203
let expected = str![[r#"
204204
error:
205205
|
@@ -2258,7 +2258,9 @@ fn main() {
22582258
.label("`+` cannot be used to concatenate two `&str` strings"),
22592259
),
22602260
)
2261-
.element(Level::NOTE.title("string concatenation requires an owned `String` on the left")),
2261+
.element(
2262+
Level::NOTE.message("string concatenation requires an owned `String` on the left"),
2263+
),
22622264
Group::with_title(Level::HELP.title("create an owned `String` from a string reference"))
22632265
.element(
22642266
Snippet::source(source)
@@ -2333,7 +2335,7 @@ fn foo() {
23332335

23342336
.annotation(AnnotationKind::Primary.span(0..0)),
23352337
)
2336-
.element(Level::NOTE.title("this error originates in the macro `include` (in Nightly builds, run with -Z macro-backtrace for more info)")),
2338+
.element(Level::NOTE.message("this error originates in the macro `include` (in Nightly builds, run with -Z macro-backtrace for more info)")),
23372339
];
23382340

23392341
let expected_ascii = str![[r#"

tests/rustc_tests.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1659,8 +1659,8 @@ fn main() {}
16591659
.annotation(AnnotationKind::Context.span(878..880).label("not covered"))
16601660
.annotation(AnnotationKind::Context.span(890..892).label("not covered"))
16611661
)
1662-
.element(Level::NOTE.title("the matched value is of type `NonEmptyEnum5`"))
1663-
.element(Level::NOTE.title("match arms with guards don't count towards exhaustivity")
1662+
.element(Level::NOTE.message("the matched value is of type `NonEmptyEnum5`"))
1663+
.element(Level::NOTE.message("match arms with guards don't count towards exhaustivity")
16641664
),
16651665
Group::with_title(
16661666
Level::HELP
@@ -1749,7 +1749,7 @@ fn main() {
17491749
.primary(true)
17501750
)
17511751
.element(Padding)
1752-
.element(Level::NOTE.title("...because it uses `Self` as a type parameter"))
1752+
.element(Level::NOTE.message("...because it uses `Self` as a type parameter"))
17531753
.element(
17541754
Snippet::source(source)
17551755
.line_start(1)
@@ -2795,9 +2795,9 @@ fn main() {
27952795
.path("lint_example.rs")
27962796
.annotation(AnnotationKind::Primary.span(40..49)),
27972797
)
2798-
.element(Level::WARNING.title("this changes meaning in Rust 2021"))
2799-
.element(Level::NOTE.title(long_title2))
2800-
.element(Level::NOTE.title("`#[warn(array_into_iter)]` on by default")),
2798+
.element(Level::WARNING.message("this changes meaning in Rust 2021"))
2799+
.element(Level::NOTE.message(long_title2))
2800+
.element(Level::NOTE.message("`#[warn(array_into_iter)]` on by default")),
28012801
Group::with_title(
28022802
Level::HELP.title("use `.iter()` instead of `.into_iter()` to avoid ambiguity"),
28032803
)

0 commit comments

Comments
 (0)