Skip to content

Commit

Permalink
fix: missing #[must_use] attribute on a method returning Self (ou…
Browse files Browse the repository at this point in the history
  • Loading branch information
vrmiguel committed Jan 15, 2022
1 parent eec1127 commit 6fc6d23
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,20 @@ impl Display for FinalError {

impl FinalError {
/// Only constructor
#[must_use]
pub fn with_title(title: impl ToString) -> Self {
Self { title: title.to_string(), details: vec![], hints: vec![] }
}

/// Add one detail line, can have multiple
#[must_use]
pub fn detail(mut self, detail: impl ToString) -> Self {
self.details.push(detail.to_string());
self
}

/// Add one hint line, can have multiple
#[must_use]
pub fn hint(mut self, hint: impl ToString) -> Self {
self.hints.push(hint.to_string());
self
Expand Down

0 comments on commit 6fc6d23

Please sign in to comment.