Skip to content

Commit b615b2d

Browse files
committed
rename instant_substraction -> time_substraction
1 parent c9cf178 commit b615b2d

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6143,7 +6143,7 @@ Released 2018-09-13
61436143
[`type_complexity`]: https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
61446144
[`type_id_on_box`]: https://rust-lang.github.io/rust-clippy/master/index.html#type_id_on_box
61456145
[`type_repetition_in_bounds`]: https://rust-lang.github.io/rust-clippy/master/index.html#type_repetition_in_bounds
6146-
[`unchecked_duration_subtraction`]: https://rust-lang.github.io/rust-clippy/master/index.html#unchecked_duration_subtraction
6146+
[`unchecked_time_subtraction`]: https://rust-lang.github.io/rust-clippy/master/index.html#unchecked_time_subtraction
61476147
[`unconditional_recursion`]: https://rust-lang.github.io/rust-clippy/master/index.html#unconditional_recursion
61486148
[`undocumented_unsafe_blocks`]: https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
61496149
[`undropped_manually_drops`]: https://rust-lang.github.io/rust-clippy/master/index.html#undropped_manually_drops

clippy_lints/src/declared_lints.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,6 @@ pub static LINTS: &[&crate::LintInfo] = &[
241241
crate::inherent_to_string::INHERENT_TO_STRING_SHADOW_DISPLAY_INFO,
242242
crate::init_numbered_fields::INIT_NUMBERED_FIELDS_INFO,
243243
crate::inline_fn_without_body::INLINE_FN_WITHOUT_BODY_INFO,
244-
crate::instant_subtraction::MANUAL_INSTANT_ELAPSED_INFO,
245-
crate::instant_subtraction::UNCHECKED_TIME_SUBTRACTION_INFO,
246244
crate::int_plus_one::INT_PLUS_ONE_INFO,
247245
crate::integer_division_remainder_used::INTEGER_DIVISION_REMAINDER_USED_INFO,
248246
crate::invalid_upcast_comparisons::INVALID_UPCAST_COMPARISONS_INFO,
@@ -711,6 +709,8 @@ pub static LINTS: &[&crate::LintInfo] = &[
711709
crate::tabs_in_doc_comments::TABS_IN_DOC_COMMENTS_INFO,
712710
crate::temporary_assignment::TEMPORARY_ASSIGNMENT_INFO,
713711
crate::tests_outside_test_module::TESTS_OUTSIDE_TEST_MODULE_INFO,
712+
crate::time_subtraction::MANUAL_INSTANT_ELAPSED_INFO,
713+
crate::time_subtraction::UNCHECKED_TIME_SUBTRACTION_INFO,
714714
crate::to_digit_is_some::TO_DIGIT_IS_SOME_INFO,
715715
crate::to_string_trait_impl::TO_STRING_TRAIT_IMPL_INFO,
716716
crate::trailing_empty_array::TRAILING_EMPTY_ARRAY_INFO,

clippy_lints/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ mod inherent_impl;
175175
mod inherent_to_string;
176176
mod init_numbered_fields;
177177
mod inline_fn_without_body;
178-
mod instant_subtraction;
179178
mod int_plus_one;
180179
mod integer_division_remainder_used;
181180
mod invalid_upcast_comparisons;
@@ -355,6 +354,7 @@ mod swap_ptr_to_ref;
355354
mod tabs_in_doc_comments;
356355
mod temporary_assignment;
357356
mod tests_outside_test_module;
357+
mod time_subtraction;
358358
mod to_digit_is_some;
359359
mod to_string_trait_impl;
360360
mod trailing_empty_array;
@@ -873,7 +873,7 @@ pub fn register_lints(store: &mut rustc_lint::LintStore, conf: &'static Conf) {
873873
store.register_late_pass(move |_| Box::new(manual_rotate::ManualRotate));
874874
store.register_late_pass(move |_| Box::new(operators::Operators::new(conf)));
875875
store.register_late_pass(move |_| Box::new(std_instead_of_core::StdReexports::new(conf)));
876-
store.register_late_pass(move |_| Box::new(instant_subtraction::InstantSubtraction::new(conf)));
876+
store.register_late_pass(move |_| Box::new(time_subtraction::TimeSubtraction::new(conf)));
877877
store.register_late_pass(|_| Box::new(partialeq_to_none::PartialeqToNone));
878878
store.register_late_pass(move |_| Box::new(manual_clamp::ManualClamp::new(conf)));
879879
store.register_late_pass(|_| Box::new(manual_string_new::ManualStringNew));
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,21 +66,21 @@ declare_clippy_lint! {
6666
"finds unchecked subtraction of a 'Duration' from an 'Instant' or 'Duration'"
6767
}
6868

69-
pub struct InstantSubtraction {
69+
pub struct TimeSubtraction {
7070
msrv: Msrv,
7171
}
7272

73-
impl InstantSubtraction {
73+
impl TimeSubtraction {
7474
pub fn new(conf: &'static Conf) -> Self {
7575
Self {
7676
msrv: conf.msrv.clone(),
7777
}
7878
}
7979
}
8080

81-
impl_lint_pass!(InstantSubtraction => [MANUAL_INSTANT_ELAPSED, UNCHECKED_TIME_SUBTRACTION]);
81+
impl_lint_pass!(TimeSubtraction => [MANUAL_INSTANT_ELAPSED, UNCHECKED_TIME_SUBTRACTION]);
8282

83-
impl LateLintPass<'_> for InstantSubtraction {
83+
impl LateLintPass<'_> for TimeSubtraction {
8484
fn check_expr(&mut self, cx: &LateContext<'_>, expr: &'_ Expr<'_>) {
8585
if let ExprKind::Binary(
8686
Spanned {

0 commit comments

Comments
 (0)