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
This commit is contained in:
commit
46b93b2e44
19 changed files with 33 additions and 40 deletions
|
|
@ -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 }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue