diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2021-02-16 19:21:20 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-16 19:21:20 +0100 |
| commit | 46b93b2e44405a3d914eb07dfe33bc39226bfe71 (patch) | |
| tree | dade0bdd8dac8da7b5b7079e0a5f848732f602c7 /src | |
| parent | cdab137bd44a12da1020444fb75efb37fd77f114 (diff) | |
| parent | 4390a61b6495765a04819130e3934ec671428bcd (diff) | |
Rollup merge of #82163 - matthiaskrgr:slice, r=jyn514
avoid full-slicing slices If we already have a slice, there is no need to get another full-range slice from that, just use the original. clippy::redundant_slicing
Diffstat (limited to 'src')
| -rw-r--r-- | src/bootstrap/flags.rs | 2 | ||||
| -rw-r--r-- | src/librustdoc/clean/mod.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/bootstrap/flags.rs b/src/bootstrap/flags.rs index 55062e11e02..6044899c237 100644 --- a/src/bootstrap/flags.rs +++ b/src/bootstrap/flags.rs @@ -347,7 +347,7 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`", }; // Done specifying what options are possible, so do the getopts parsing - let matches = opts.parse(&args[..]).unwrap_or_else(|e| { + let matches = opts.parse(args).unwrap_or_else(|e| { // Invalid argument/option format println!("\n{}\n", e); usage(1, &opts, false, &subcommand_help); diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 3decdd02b00..f3aeea4b8c9 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -975,7 +975,7 @@ where { fn clean(&self, cx: &DocContext<'_>) -> FnDecl { FnDecl { - inputs: (&self.0.inputs[..], self.1).clean(cx), + inputs: (self.0.inputs, self.1).clean(cx), output: self.0.output.clean(cx), c_variadic: self.0.c_variadic, attrs: Attributes::default(), @@ -1939,7 +1939,7 @@ impl Clean<String> for Symbol { impl Clean<BareFunctionDecl> for hir::BareFnTy<'_> { fn clean(&self, cx: &DocContext<'_>) -> BareFunctionDecl { let (generic_params, decl) = enter_impl_trait(cx, || { - (self.generic_params.clean(cx), (&*self.decl, &self.param_names[..]).clean(cx)) + (self.generic_params.clean(cx), (&*self.decl, self.param_names).clean(cx)) }); BareFunctionDecl { unsafety: self.unsafety, abi: self.abi, decl, generic_params } } |
