diff options
author | Joel Galenson <jgalenson@google.com> | 2021-04-01 15:23:05 -0700 |
---|---|---|
committer | Joel Galenson <jgalenson@google.com> | 2021-04-01 15:23:05 -0700 |
commit | a66c7cb6fb7d79833035fe9f6b76ca6f3fed58e6 (patch) | |
tree | 89ab9e60d48848bb5acb8f454042572d52c45f54 /src/diagnostic.rs | |
parent | 35326cce9698db9c5eb0a16e4b46da4fc21ea609 (diff) | |
download | codespan-reporting-a66c7cb6fb7d79833035fe9f6b76ca6f3fed58e6.tar.gz |
Upgrade rust/crates/codespan-reporting to 0.11.1android-s-beta-2android-s-beta-1
Test: make
Change-Id: I5830c727a13bfdf64b23000bb0272636143f7c1c
Diffstat (limited to 'src/diagnostic.rs')
-rw-r--r-- | src/diagnostic.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/diagnostic.rs b/src/diagnostic.rs index 7dddcec..c1f98bd 100644 --- a/src/diagnostic.rs +++ b/src/diagnostic.rs @@ -183,27 +183,27 @@ impl<FileId> Diagnostic<FileId> { Diagnostic::new(Severity::Help) } - /// Add an error code to the diagnostic. + /// Set the error code of the diagnostic. pub fn with_code(mut self, code: impl Into<String>) -> Diagnostic<FileId> { self.code = Some(code.into()); self } - /// Add a message to the diagnostic. + /// Set the message of the diagnostic. pub fn with_message(mut self, message: impl Into<String>) -> Diagnostic<FileId> { self.message = message.into(); self } /// Add some labels to the diagnostic. - pub fn with_labels(mut self, labels: Vec<Label<FileId>>) -> Diagnostic<FileId> { - self.labels = labels; + pub fn with_labels(mut self, mut labels: Vec<Label<FileId>>) -> Diagnostic<FileId> { + self.labels.append(&mut labels); self } /// Add some notes to the diagnostic. - pub fn with_notes(mut self, notes: Vec<String>) -> Diagnostic<FileId> { - self.notes = notes; + pub fn with_notes(mut self, mut notes: Vec<String>) -> Diagnostic<FileId> { + self.notes.append(&mut notes); self } } |