Skip to content

Commit

Permalink
fix(protocol): use references forr all return values in Diagnostic
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Aug 3, 2021
1 parent e2387ce commit c3f41b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ pub trait Diagnostic: std::error::Error + Send + Sync + 'static {
/// the toplevel crate's documentation for easy searching. Rust path
/// format (`foo::bar::baz`) is recommended, but more classic codes like
/// `E0123` or Enums will work just fine.
fn code(&self) -> Box<dyn Display>;
fn code(&self) -> &(dyn Display + 'static);

/// Diagnostic severity. This may be used by [Reporter]s to change the
/// display format of this diagnostic.
fn severity(&self) -> Severity;

/// Additional help text related to this Diagnostic. Do you have any
/// advice for the poor soul who's just run into this issue?
fn help(&self) -> Option<Vec<Box<dyn Display>>> {
fn help(&self) -> Option<&[&str]> {
None
}

Expand Down

0 comments on commit c3f41b9

Please sign in to comment.