v.0.9.0 #136
clippy
36 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 36 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.74.0 (79e9716c9 2023-11-13)
- cargo 1.74.0 (ecb9851af 2023-10-18)
- clippy 0.1.74 (79e9716 2023-11-13)
Annotations
Check warning on line 77 in examples/src/bin/extract_page.rs
github-actions / clippy
field assignment outside of initializer for an instance created with Default::default()
warning: field assignment outside of initializer for an instance created with Default::default()
--> examples/src/bin/extract_page.rs:77:5
|
77 | info.title = Some(PdfString::from("test"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: consider initializing the variable with `pdf::object::InfoDict { title: Some(PdfString::from("test")), ..Default::default() }` and removing relevant reassignments
--> examples/src/bin/extract_page.rs:76:5
|
76 | let mut info = InfoDict::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
= note: `#[warn(clippy::field_reassign_with_default)]` on by default
Check warning on line 267 in pdf/src/build.rs
github-actions / clippy
this expression creates a reference which is immediately dereferenced by the compiler
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> pdf/src/build.rs:267:36
|
267 | match self.map.get(&r1) {
| ^^^ help: change this to: `r1`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Check warning on line 749 in pdf/src/object/mod.rs
github-actions / clippy
this expression borrows a value the compiler would automatically borrow
warning: this expression borrows a value the compiler would automatically borrow
--> pdf/src/object/mod.rs:749:21
|
749 | Ok(Box::new((&**self).deep_clone(cloner)?))
| ^^^^^^^^^ help: change this to: `(**self)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
Check warning on line 592 in pdf/src/object/mod.rs
github-actions / clippy
this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec`
warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec`
--> pdf/src/object/mod.rs:592:70
|
592 | Primitive::Array(ref parts) => Ok(Primitive::Array(parts.into_iter().map(|p| p.deep_clone(cloner)).try_collect()?)),
| ^^^^^^^^^ help: call directly: `iter`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
= note: `#[warn(clippy::into_iter_on_ref)]` on by default
Check warning on line 396 in pdf/src/build.rs
github-actions / clippy
unused variable: `old`
warning: unused variable: `old`
--> pdf/src/build.rs:396:22
|
396 | if let Some((old, new)) = self.shared.get(&key) {
| ^^^ help: if this is intentional, prefix it with an underscore: `_old`
Check warning on line 105 in pdf/src/encoding.rs
github-actions / clippy
unused variable: `cloner`
warning: unused variable: `cloner`
--> pdf/src/encoding.rs:105:26
|
105 | fn deep_clone(&self, cloner: &mut impl pdf::object::Cloner) -> Result<Self> {
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_cloner`
Check warning on line 267 in pdf/src/primitive.rs
github-actions / clippy
unused variable: `update`
warning: unused variable: `update`
--> pdf/src/primitive.rs:267:28
|
267 | fn to_primitive(&self, update: &mut impl Updater) -> Result<Primitive> {
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_update`
Check warning on line 756 in pdf/src/object/mod.rs
github-actions / clippy
unused variable: `cloner`
warning: unused variable: `cloner`
--> pdf/src/object/mod.rs:756:38
|
756 | fn deep_clone(&self, cloner: &mut impl Cloner) -> Result<Self> {
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_cloner`
...
763 | deep_clone_simple!(f32, i32, u32, bool, Name, (), Date, PdfString, Rect, u8, Arc<[u8]>, Vec<u16>);
| ------------------------------------------------------------------------------------------------- in this macro invocation
|
= note: this warning originates in the macro `deep_clone_simple` (in Nightly builds, run with -Z macro-backtrace for more info)
Check warning on line 756 in pdf/src/object/mod.rs
github-actions / clippy
unused variable: `cloner`
warning: unused variable: `cloner`
--> pdf/src/object/mod.rs:756:38
|
756 | fn deep_clone(&self, cloner: &mut impl Cloner) -> Result<Self> {
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_cloner`
...
763 | deep_clone_simple!(f32, i32, u32, bool, Name, (), Date, PdfString, Rect, u8, Arc<[u8]>, Vec<u16>);
| ------------------------------------------------------------------------------------------------- in this macro invocation
|
= note: this warning originates in the macro `deep_clone_simple` (in Nightly builds, run with -Z macro-backtrace for more info)
Check warning on line 756 in pdf/src/object/mod.rs
github-actions / clippy
unused variable: `cloner`
warning: unused variable: `cloner`
--> pdf/src/object/mod.rs:756:38
|
756 | fn deep_clone(&self, cloner: &mut impl Cloner) -> Result<Self> {
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_cloner`
...
763 | deep_clone_simple!(f32, i32, u32, bool, Name, (), Date, PdfString, Rect, u8, Arc<[u8]>, Vec<u16>);
| ------------------------------------------------------------------------------------------------- in this macro invocation
|
= note: this warning originates in the macro `deep_clone_simple` (in Nightly builds, run with -Z macro-backtrace for more info)
Check warning on line 756 in pdf/src/object/mod.rs
github-actions / clippy
unused variable: `cloner`
warning: unused variable: `cloner`
--> pdf/src/object/mod.rs:756:38
|
756 | fn deep_clone(&self, cloner: &mut impl Cloner) -> Result<Self> {
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_cloner`
...
763 | deep_clone_simple!(f32, i32, u32, bool, Name, (), Date, PdfString, Rect, u8, Arc<[u8]>, Vec<u16>);
| ------------------------------------------------------------------------------------------------- in this macro invocation
|
= note: this warning originates in the macro `deep_clone_simple` (in Nightly builds, run with -Z macro-backtrace for more info)
Check warning on line 756 in pdf/src/object/mod.rs
github-actions / clippy
unused variable: `cloner`
warning: unused variable: `cloner`
--> pdf/src/object/mod.rs:756:38
|
756 | fn deep_clone(&self, cloner: &mut impl Cloner) -> Result<Self> {
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_cloner`
...
763 | deep_clone_simple!(f32, i32, u32, bool, Name, (), Date, PdfString, Rect, u8, Arc<[u8]>, Vec<u16>);
| ------------------------------------------------------------------------------------------------- in this macro invocation
|
= note: this warning originates in the macro `deep_clone_simple` (in Nightly builds, run with -Z macro-backtrace for more info)
Check warning on line 756 in pdf/src/object/mod.rs
github-actions / clippy
unused variable: `cloner`
warning: unused variable: `cloner`
--> pdf/src/object/mod.rs:756:38
|
756 | fn deep_clone(&self, cloner: &mut impl Cloner) -> Result<Self> {
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_cloner`
...
763 | deep_clone_simple!(f32, i32, u32, bool, Name, (), Date, PdfString, Rect, u8, Arc<[u8]>, Vec<u16>);
| ------------------------------------------------------------------------------------------------- in this macro invocation
|
= note: this warning originates in the macro `deep_clone_simple` (in Nightly builds, run with -Z macro-backtrace for more info)
Check warning on line 756 in pdf/src/object/mod.rs
github-actions / clippy
unused variable: `cloner`
warning: unused variable: `cloner`
--> pdf/src/object/mod.rs:756:38
|
756 | fn deep_clone(&self, cloner: &mut impl Cloner) -> Result<Self> {
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_cloner`
...
763 | deep_clone_simple!(f32, i32, u32, bool, Name, (), Date, PdfString, Rect, u8, Arc<[u8]>, Vec<u16>);
| ------------------------------------------------------------------------------------------------- in this macro invocation
|
= note: this warning originates in the macro `deep_clone_simple` (in Nightly builds, run with -Z macro-backtrace for more info)
Check warning on line 756 in pdf/src/object/mod.rs
github-actions / clippy
unused variable: `cloner`
warning: unused variable: `cloner`
--> pdf/src/object/mod.rs:756:38
|
756 | fn deep_clone(&self, cloner: &mut impl Cloner) -> Result<Self> {
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_cloner`
...
763 | deep_clone_simple!(f32, i32, u32, bool, Name, (), Date, PdfString, Rect, u8, Arc<[u8]>, Vec<u16>);
| ------------------------------------------------------------------------------------------------- in this macro invocation
|
= note: this warning originates in the macro `deep_clone_simple` (in Nightly builds, run with -Z macro-backtrace for more info)
Check warning on line 756 in pdf/src/object/mod.rs
github-actions / clippy
unused variable: `cloner`
warning: unused variable: `cloner`
--> pdf/src/object/mod.rs:756:38
|
756 | fn deep_clone(&self, cloner: &mut impl Cloner) -> Result<Self> {
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_cloner`
...
763 | deep_clone_simple!(f32, i32, u32, bool, Name, (), Date, PdfString, Rect, u8, Arc<[u8]>, Vec<u16>);
| ------------------------------------------------------------------------------------------------- in this macro invocation
|
= note: this warning originates in the macro `deep_clone_simple` (in Nightly builds, run with -Z macro-backtrace for more info)
Check warning on line 756 in pdf/src/object/mod.rs
github-actions / clippy
unused variable: `cloner`
warning: unused variable: `cloner`
--> pdf/src/object/mod.rs:756:38
|
756 | fn deep_clone(&self, cloner: &mut impl Cloner) -> Result<Self> {
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_cloner`
...
763 | deep_clone_simple!(f32, i32, u32, bool, Name, (), Date, PdfString, Rect, u8, Arc<[u8]>, Vec<u16>);
| ------------------------------------------------------------------------------------------------- in this macro invocation
|
= note: this warning originates in the macro `deep_clone_simple` (in Nightly builds, run with -Z macro-backtrace for more info)
Check warning on line 756 in pdf/src/object/mod.rs
github-actions / clippy
unused variable: `cloner`
warning: unused variable: `cloner`
--> pdf/src/object/mod.rs:756:38
|
756 | fn deep_clone(&self, cloner: &mut impl Cloner) -> Result<Self> {
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_cloner`
...
763 | deep_clone_simple!(f32, i32, u32, bool, Name, (), Date, PdfString, Rect, u8, Arc<[u8]>, Vec<u16>);
| ------------------------------------------------------------------------------------------------- in this macro invocation
|
= note: this warning originates in the macro `deep_clone_simple` (in Nightly builds, run with -Z macro-backtrace for more info)
Check warning on line 756 in pdf/src/object/mod.rs
github-actions / clippy
unused variable: `cloner`
warning: unused variable: `cloner`
--> pdf/src/object/mod.rs:756:38
|
756 | fn deep_clone(&self, cloner: &mut impl Cloner) -> Result<Self> {
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_cloner`
...
763 | deep_clone_simple!(f32, i32, u32, bool, Name, (), Date, PdfString, Rect, u8, Arc<[u8]>, Vec<u16>);
| ------------------------------------------------------------------------------------------------- in this macro invocation
|
= note: this warning originates in the macro `deep_clone_simple` (in Nightly builds, run with -Z macro-backtrace for more info)
Check warning on line 85 in pdf/src/object/mod.rs
github-actions / clippy
unused variable: `range`
warning: unused variable: `range`
--> pdf/src/object/mod.rs:85:41
|
85 | fn stream_data(&self, id: PlainRef, range: Range<usize>) -> Result<Arc<[u8]>> {
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_range`
Check warning on line 85 in pdf/src/object/mod.rs
github-actions / clippy
unused variable: `id`
warning: unused variable: `id`
--> pdf/src/object/mod.rs:85:27
|
85 | fn stream_data(&self, id: PlainRef, range: Range<usize>) -> Result<Arc<[u8]>> {
| ^^ help: if this is intentional, prefix it with an underscore: `_id`
Check warning on line 208 in pdf/src/object/function.rs
github-actions / clippy
unused variable: `cloner`
warning: unused variable: `cloner`
--> pdf/src/object/function.rs:208:26
|
208 | fn deep_clone(&self, cloner: &mut impl Cloner) -> Result<Self> {
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_cloner`
Check warning on line 182 in pdf/src/object/function.rs
github-actions / clippy
unused variable: `update`
warning: unused variable: `update`
--> pdf/src/object/function.rs:182:28
|
182 | fn to_primitive(&self, update: &mut impl Updater) -> Result<Primitive> {
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_update`
|
= note: `#[warn(unused_variables)]` on by default
Check warning on line 755 in pdf_derive/src/lib.rs
github-actions / clippy
variable does not need to be mutable
warning: variable does not need to be mutable
--> pdf_derive/src/lib.rs:755:25
|
755 | let (impl_generics, mut ty_generics, where_clause) = generics.split_for_impl();
| ----^^^^^^^^^^^
| |
| help: remove this `mut`
|
= note: `#[warn(unused_mut)]` on by default
Check warning on line 457 in pdf_derive/src/lib.rs
github-actions / clippy
unused variable: `f`
warning: unused variable: `f`
--> pdf_derive/src/lib.rs:457:85
|
457 | let labels: Vec<Ident> = fields.unnamed.iter().enumerate().map(|(i, f)| {
| ^ help: if this is intentional, prefix it with an underscore: `_f`