Delete unused Violation::explanation method (#10600)

This commit is contained in:
Micha Reiser 2024-03-26 12:35:27 +01:00 committed by GitHub
parent 877a9145ae
commit b49b861b2d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -25,11 +25,6 @@ pub trait Violation: Debug + PartialEq + Eq {
/// The message used to describe the violation. /// The message used to describe the violation.
fn message(&self) -> String; fn message(&self) -> String;
/// The explanation used in documentation and elsewhere.
fn explanation() -> Option<&'static str> {
None
}
// TODO(micha): Move `fix_title` to `Fix`, add new `advice` method that is shown as an advice. // TODO(micha): Move `fix_title` to `Fix`, add new `advice` method that is shown as an advice.
// Change the `Diagnostic` renderer to show the advice, and render the fix message after the `Suggested fix: <here>` // Change the `Diagnostic` renderer to show the advice, and render the fix message after the `Suggested fix: <here>`
@ -50,11 +45,6 @@ pub trait AlwaysFixableViolation: Debug + PartialEq + Eq {
/// The message used to describe the violation. /// The message used to describe the violation.
fn message(&self) -> String; fn message(&self) -> String;
/// The explanation used in documentation and elsewhere.
fn explanation() -> Option<&'static str> {
None
}
/// The title displayed for the available fix. /// The title displayed for the available fix.
fn fix_title(&self) -> String; fn fix_title(&self) -> String;
@ -71,10 +61,6 @@ impl<V: AlwaysFixableViolation> Violation for V {
<Self as AlwaysFixableViolation>::message(self) <Self as AlwaysFixableViolation>::message(self)
} }
fn explanation() -> Option<&'static str> {
<Self as AlwaysFixableViolation>::explanation()
}
fn fix_title(&self) -> Option<String> { fn fix_title(&self) -> Option<String> {
Some(<Self as AlwaysFixableViolation>::fix_title(self)) Some(<Self as AlwaysFixableViolation>::fix_title(self))
} }