File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ pub struct File<'a> {
58
58
impl < ' a > File < ' a > {
59
59
/// Opens a file panicking on failure.
60
60
#[ track_caller]
61
- pub fn open ( path : & ' a ( impl AsRef < Path > + ?Sized ) , options : & mut OpenOptions ) -> Self {
61
+ pub fn open ( path : & ' a ( impl AsRef < Path > + ?Sized ) , options : & OpenOptions ) -> Self {
62
62
let path = path. as_ref ( ) ;
63
63
Self {
64
64
inner : expect_action ( options. open ( path) , ErrAction :: Open , path) ,
@@ -68,7 +68,7 @@ impl<'a> File<'a> {
68
68
69
69
/// Opens a file if it exists, panicking on any other failure.
70
70
#[ track_caller]
71
- pub fn open_if_exists ( path : & ' a ( impl AsRef < Path > + ?Sized ) , options : & mut OpenOptions ) -> Option < Self > {
71
+ pub fn open_if_exists ( path : & ' a ( impl AsRef < Path > + ?Sized ) , options : & OpenOptions ) -> Option < Self > {
72
72
let path = path. as_ref ( ) ;
73
73
match options. open ( path) {
74
74
Ok ( inner) => Some ( Self { inner, path } ) ,
Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ enum VecToArray {
106
106
impl UselessVec {
107
107
/// Checks if the surrounding environment requires this expression to actually be of type
108
108
/// `Vec<_>`, or if it can be changed to `&[]`/`[]` without causing type errors.
109
- fn expr_usage_requires_vec ( & mut self , cx : & LateContext < ' _ > , expr : & Expr < ' _ > ) -> VecToArray {
109
+ fn expr_usage_requires_vec ( & self , cx : & LateContext < ' _ > , expr : & Expr < ' _ > ) -> VecToArray {
110
110
match cx. tcx . parent_hir_node ( expr. hir_id ) {
111
111
// search for `let foo = vec![_]` expressions where all uses of `foo`
112
112
// adjust to slices or call a method that exist on slices (e.g. len)
Original file line number Diff line number Diff line change @@ -91,6 +91,8 @@ fn run_clippy_for_package(project: &str) -> bool {
91
91
"clippy::pedantic" ,
92
92
"-D" ,
93
93
"clippy::dbg_macro" ,
94
+ "-D" ,
95
+ "clippy::needless_pass_by_ref_mut" ,
94
96
] ) ;
95
97
if !cfg ! ( feature = "internal" ) {
96
98
// running a clippy built without internal lints on the clippy source
You can’t perform that action at this time.
0 commit comments