Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
I'm applying these from the UI, but will come back and do the remaining comments and squash it all together with the original commit

Co-authored-by: Alejandra González <blyxyas@gmail.com>
  • Loading branch information
declanvk and blyxyas authored Apr 25, 2024
1 parent 056ed4a commit 57fe0ef
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions clippy_lints/src/duration_to_float_precision_loss.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ declare_clippy_lint! {
/// precision is lost.
///
/// ### Why is this bad?
/// This can be bad if the user wanted to retain the full precision of the duration.
/// Retaining the full precision of a duration is usually desired.
///
/// ### Example
/// ```no_run
Expand Down Expand Up @@ -48,18 +48,18 @@ declare_clippy_lint! {
/// # let duration = Duration::from_nanos(1234500000);
/// let _ = duration.as_secs_f64();
/// ```
#[clippy::version = "1.78.0"]
#[clippy::version = "1.79.0"]
pub DURATION_TO_FLOAT_PRECISION_LOSS,
nursery,
style,
"conversion from duration to float that cause loss of precision"
}

/// This struct implements the logic needed to apply the lint
#[derive(Debug)]
pub struct DurationToFloatPrecisionLoss {
// This vector is used to prevent applying the lint to a sub-expression
/// This vector is used to prevent applying the lint to a sub-expression
lint_applications: Vec<Span>,
// `as_secs_f64` isn't applicable until 1.38.0
/// `as_secs_f64` isn't applicable until 1.38.0
msrv: Msrv,
}

Expand Down

0 comments on commit 57fe0ef

Please sign in to comment.