Skip to content

Commit 12a7f21

Browse files
committed
rename instant_substraction -> time_substraction
1 parent def561a commit 12a7f21

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
@@ -6192,7 +6192,7 @@ Released 2018-09-13
61926192
[`type_id_on_box`]: https://rust-lang.github.io/rust-clippy/master/index.html#type_id_on_box
61936193
[`type_repetition_in_bounds`]: https://rust-lang.github.io/rust-clippy/master/index.html#type_repetition_in_bounds
61946194
[`unbuffered_bytes`]: https://rust-lang.github.io/rust-clippy/master/index.html#unbuffered_bytes
6195-
[`unchecked_duration_subtraction`]: https://rust-lang.github.io/rust-clippy/master/index.html#unchecked_duration_subtraction
6195+
[`unchecked_time_subtraction`]: https://rust-lang.github.io/rust-clippy/master/index.html#unchecked_time_subtraction
61966196
[`unconditional_recursion`]: https://rust-lang.github.io/rust-clippy/master/index.html#unconditional_recursion
61976197
[`undocumented_unsafe_blocks`]: https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks
61986198
[`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
@@ -242,8 +242,6 @@ pub static LINTS: &[&crate::LintInfo] = &[
242242
crate::inherent_to_string::INHERENT_TO_STRING_SHADOW_DISPLAY_INFO,
243243
crate::init_numbered_fields::INIT_NUMBERED_FIELDS_INFO,
244244
crate::inline_fn_without_body::INLINE_FN_WITHOUT_BODY_INFO,
245-
crate::instant_subtraction::MANUAL_INSTANT_ELAPSED_INFO,
246-
crate::instant_subtraction::UNCHECKED_TIME_SUBTRACTION_INFO,
247245
crate::int_plus_one::INT_PLUS_ONE_INFO,
248246
crate::integer_division_remainder_used::INTEGER_DIVISION_REMAINDER_USED_INFO,
249247
crate::invalid_upcast_comparisons::INVALID_UPCAST_COMPARISONS_INFO,
@@ -717,6 +715,8 @@ pub static LINTS: &[&crate::LintInfo] = &[
717715
crate::tabs_in_doc_comments::TABS_IN_DOC_COMMENTS_INFO,
718716
crate::temporary_assignment::TEMPORARY_ASSIGNMENT_INFO,
719717
crate::tests_outside_test_module::TESTS_OUTSIDE_TEST_MODULE_INFO,
718+
crate::time_subtraction::MANUAL_INSTANT_ELAPSED_INFO,
719+
crate::time_subtraction::UNCHECKED_TIME_SUBTRACTION_INFO,
720720
crate::to_digit_is_some::TO_DIGIT_IS_SOME_INFO,
721721
crate::to_string_trait_impl::TO_STRING_TRAIT_IMPL_INFO,
722722
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
@@ -176,7 +176,6 @@ mod inherent_impl;
176176
mod inherent_to_string;
177177
mod init_numbered_fields;
178178
mod inline_fn_without_body;
179-
mod instant_subtraction;
180179
mod int_plus_one;
181180
mod integer_division_remainder_used;
182181
mod invalid_upcast_comparisons;
@@ -357,6 +356,7 @@ mod swap_ptr_to_ref;
357356
mod tabs_in_doc_comments;
358357
mod temporary_assignment;
359358
mod tests_outside_test_module;
359+
mod time_subtraction;
360360
mod to_digit_is_some;
361361
mod to_string_trait_impl;
362362
mod trailing_empty_array;
@@ -875,7 +875,7 @@ pub fn register_lints(store: &mut rustc_lint::LintStore, conf: &'static Conf) {
875875
store.register_late_pass(move |_| Box::new(manual_rotate::ManualRotate));
876876
store.register_late_pass(move |_| Box::new(operators::Operators::new(conf)));
877877
store.register_late_pass(move |_| Box::new(std_instead_of_core::StdReexports::new(conf)));
878-
store.register_late_pass(move |_| Box::new(instant_subtraction::InstantSubtraction::new(conf)));
878+
store.register_late_pass(move |_| Box::new(time_subtraction::TimeSubtraction::new(conf)));
879879
store.register_late_pass(|_| Box::new(partialeq_to_none::PartialeqToNone));
880880
store.register_late_pass(move |_| Box::new(manual_clamp::ManualClamp::new(conf)));
881881
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)