pub struct Suggestion { /* private fields */ }Expand description
Represents a fix-it suggestion.
Implementations§
Source§impl Suggestion
impl Suggestion
Sourcepub fn new(
message: impl Into<String>,
replacement: impl Into<String>,
applicability: Applicability,
) -> Self
pub fn new( message: impl Into<String>, replacement: impl Into<String>, applicability: Applicability, ) -> Self
Creates a new suggestion.
§Examples
use whitaker_common::diagnostics::{Applicability, Suggestion};
let suggestion = Suggestion::new("Use expect", "expect(...)", Applicability::MaybeIncorrect);
assert_eq!(suggestion.message(), "Use expect");Sourcepub fn replacement(&self) -> &str
pub fn replacement(&self) -> &str
Returns the replacement snippet.
Sourcepub const fn applicability(&self) -> Applicability
pub const fn applicability(&self) -> Applicability
Returns the applicability classification.
Trait Implementations§
Source§impl Clone for Suggestion
impl Clone for Suggestion
Source§fn clone(&self) -> Suggestion
fn clone(&self) -> Suggestion
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Suggestion
impl Debug for Suggestion
impl Eq for Suggestion
Source§impl PartialEq for Suggestion
impl PartialEq for Suggestion
impl StructuralPartialEq for Suggestion
Auto Trait Implementations§
impl Freeze for Suggestion
impl RefUnwindSafe for Suggestion
impl Send for Suggestion
impl Sync for Suggestion
impl Unpin for Suggestion
impl UnsafeUnpin for Suggestion
impl UnwindSafe for Suggestion
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more