Skip to content

Commit b1527ee

Browse files
committed
fix(shell): Switch to annotate snippets for notes
1 parent 89b02af commit b1527ee

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/cargo/core/shell.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,10 @@ impl Shell {
227227

228228
/// Prints a cyan 'note' message.
229229
pub fn note<T: fmt::Display>(&mut self, message: T) -> CargoResult<()> {
230-
self.print(&"note", Some(&message), &NOTE, false)
230+
let report = &[annotate_snippets::Group::with_title(
231+
annotate_snippets::Level::NOTE.secondary_title(message.to_string()),
232+
)];
233+
self.print_report(report, false)
231234
}
232235

233236
/// Updates the verbosity of the shell.

tests/testsuite/publish.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3428,7 +3428,7 @@ See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for
34283428
[UPLOADING] dep v0.0.1 ([ROOT]/foo/dep)
34293429
[UPLOADED] dep v0.0.1 to registry `crates-io`
34303430
[NOTE] waiting for dep v0.0.1 to be available at registry `crates-io`.
3431-
2 remaining crates to be published
3431+
2 remaining crates to be published
34323432
[WARNING] timed out waiting for dep v0.0.1 to be available in registry `crates-io`
34333433
[NOTE] the registry may have a backlog that is delaying making the crate available. The crate should be available soon.
34343434
[ERROR] unable to publish main v0.0.1 and other v0.0.1 due to a timeout while waiting for published dependencies to be available.
@@ -3751,12 +3751,12 @@ fn workspace_with_local_deps() {
37513751
[UPLOADING] level3 v0.0.1 ([ROOT]/foo/level3)
37523752
[UPLOADED] level3 v0.0.1 to registry `crates-io`
37533753
[NOTE] waiting for level3 v0.0.1 to be available at registry `crates-io`.
3754-
2 remaining crates to be published
3754+
2 remaining crates to be published
37553755
[PUBLISHED] level3 v0.0.1 at registry `crates-io`
37563756
[UPLOADING] level2 v0.0.1 ([ROOT]/foo/level2)
37573757
[UPLOADED] level2 v0.0.1 to registry `crates-io`
37583758
[NOTE] waiting for level2 v0.0.1 to be available at registry `crates-io`.
3759-
1 remaining crate to be published
3759+
1 remaining crate to be published
37603760
[PUBLISHED] level2 v0.0.1 at registry `crates-io`
37613761
[UPLOADING] level1 v0.0.1 ([ROOT]/foo/level1)
37623762
[UPLOADED] level1 v0.0.1 to registry `crates-io`
@@ -3855,7 +3855,7 @@ fn workspace_parallel() {
38553855
[UPLOADED] b v0.0.1 to registry `crates-io`
38563856
[UPLOADED] a v0.0.1 to registry `crates-io`
38573857
[NOTE] waiting for a v0.0.1 or b v0.0.1 to be available at registry `crates-io`.
3858-
1 remaining crate to be published
3858+
1 remaining crate to be published
38593859
[PUBLISHED] a v0.0.1 and b v0.0.1 at registry `crates-io`
38603860
[UPLOADING] c v0.0.1 ([ROOT]/foo/c)
38613861
[UPLOADED] c v0.0.1 to registry `crates-io`

0 commit comments

Comments
 (0)