fix: missing #[must_use] attribute on a method returning Self (#243)

This commit is contained in:
Vinícius Miguel 2022-01-15 16:14:23 -03:00 committed by GitHub
parent eec1127ee9
commit 6fc6d23872
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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