Skip to content

Commit 18bd97f

Browse files
committed
Renamed lint to join_absolute_path as per request.
1 parent c36de32 commit 18bd97f

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4935,7 +4935,7 @@ Released 2018-09-13
49354935
[`partialeq_ne_impl`]: https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_ne_impl
49364936
[`partialeq_to_none`]: https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none
49374937
[`path_buf_push_overwrite`]: https://rust-lang.github.io/rust-clippy/master/index.html#path_buf_push_overwrite
4938-
[`path_join_correction`]: https://rust-lang.github.io/rust-clippy/master/index.html#path_join_correction
4938+
[`join_absolute_path`]: https://rust-lang.github.io/rust-clippy/master/index.html#join_absolute_path
49394939
[`pattern_type_mismatch`]: https://rust-lang.github.io/rust-clippy/master/index.html#pattern_type_mismatch
49404940
[`permissions_set_readonly_false`]: https://rust-lang.github.io/rust-clippy/master/index.html#permissions_set_readonly_false
49414941
[`positional_named_format_parameters`]: https://rust-lang.github.io/rust-clippy/master/index.html#positional_named_format_parameters

clippy_lints/src/declared_lints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ pub(crate) static LINTS: &[&crate::LintInfo] = &[
380380
crate::methods::OR_FUN_CALL_INFO,
381381
crate::methods::OR_THEN_UNWRAP_INFO,
382382
crate::methods::PATH_BUF_PUSH_OVERWRITE_INFO,
383-
crate::methods::PATH_JOIN_CORRECTION_INFO,
383+
crate::methods::JOIN_ABSOLUTE_PATH_INFO,
384384
crate::methods::RANGE_ZIP_WITH_LEN_INFO,
385385
crate::methods::REPEAT_ONCE_INFO,
386386
crate::methods::RESULT_MAP_OR_INTO_OPTION_INFO,

clippy_lints/src/methods/path_join_correction.rs renamed to clippy_lints/src/methods/join_absolute_path.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use rustc_hir::{Expr, ExprKind};
55
use rustc_lint::LateContext;
66
use rustc_span::{symbol::sym::Path, Span};
77

8-
use super::PATH_JOIN_CORRECTION;
8+
use super::JOIN_ABSOLUTE_PATH;
99

1010
pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>, join_arg: &'tcx Expr<'tcx>, span: Span) {
1111
let ty = cx.typeck_results().expr_ty(expr);
@@ -18,7 +18,7 @@ pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>, join_a
1818
then {
1919
span_lint_and_sugg(
2020
cx,
21-
PATH_JOIN_CORRECTION,
21+
JOIN_ABSOLUTE_PATH,
2222
span.with_hi(expr.span.hi()),
2323
r#"argument in join called on path contains a starting '/'"#,
2424
"try removing first '/' or '\\'",

clippy_lints/src/methods/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ mod option_map_unwrap_or;
6969
mod or_fun_call;
7070
mod or_then_unwrap;
7171
mod path_buf_push_overwrite;
72-
mod path_join_correction;
72+
mod join_absolute_path;
7373
mod range_zip_with_len;
7474
mod repeat_once;
7575
mod search_is_some;
@@ -3225,7 +3225,7 @@ declare_clippy_lint! {
32253225
/// assert_eq!(new, std::path::PathBuf::from("/sh"));
32263226
/// ```
32273227
#[clippy::version = "1.70.0"]
3228-
pub PATH_JOIN_CORRECTION,
3228+
pub JOIN_ABSOLUTE_PATH,
32293229
pedantic,
32303230
"arg to .join called on a Path contains '/' at the start"
32313231
}
@@ -3381,7 +3381,7 @@ impl_lint_pass!(Methods => [
33813381
NEEDLESS_COLLECT,
33823382
SUSPICIOUS_COMMAND_ARG_SPACE,
33833383
CLEAR_WITH_DRAIN,
3384-
PATH_JOIN_CORRECTION,
3384+
JOIN_ABSOLUTE_PATH,
33853385
MANUAL_NEXT_BACK,
33863386
]);
33873387

@@ -3691,7 +3691,7 @@ impl Methods {
36913691
if let Some(("collect", _, _, span, _)) = method_call(recv) {
36923692
unnecessary_join::check(cx, expr, recv, join_arg, span);
36933693
}
3694-
else {path_join_correction::check(cx, expr, join_arg, span);}
3694+
else {join_absolute_path::check(cx, expr, join_arg, span);}
36953695
},
36963696
("last", []) | ("skip", [_]) => {
36973697
if let Some((name2, recv2, args2, _span2, _)) = method_call(recv) {

tests/ui/path_join_correction.rs renamed to tests/ui/join_absolute_path.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// run-rustfix
22
#![allow(unused)]
3-
#![warn(clippy::path_join_correction)]
3+
#![warn(clippy::join_absolute_path)]
44
use std::path::Path;
55

66
fn main() {

0 commit comments

Comments
 (0)