clippy
3 errors, 47 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 3 |
Warning | 47 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.75.0 (82e1608df 2023-12-21)
- cargo 1.75.0 (1d8b05cdd 2023-11-20)
- clippy 0.1.75 (82e1608 2023-12-21)
Annotations
Check failure on line 49 in examples/src/bin/form.rs
github-actions / clippy
no field `normal` on type `&_`
error[E0609]: no field `normal` on type `&_`
--> examples/src/bin/form.rs:49:48
|
49 | let normal = file.resolver().get(a.normal);
| ^^^^^^
Check failure on line 48 in examples/src/bin/form.rs
github-actions / clippy
no field `appearance_streams` on type `pdf::object::RcRef<_>`
error[E0609]: no field `appearance_streams` on type `pdf::object::RcRef<_>`
--> examples/src/bin/form.rs:48:36
|
48 | if let Some(ref a) = annot.appearance_streams {
| ^^^^^^^^^^^^^^^^^^ unknown field
Check failure on line 47 in examples/src/bin/form.rs
github-actions / clippy
mismatched types
error[E0308]: mismatched types
--> examples/src/bin/form.rs:47:41
|
47 | let annot = file.resolver().get(annot)?;
| --- ^^^^^ expected `Ref<_>`, found `MaybeRef<Annot>`
| |
| arguments to this method are incorrect
|
= note: expected struct `pdf::object::Ref<_>`
found enum `pdf::object::MaybeRef<pdf::object::Annot>`
note: method defined here
--> /home/runner/work/pdf/pdf/pdf/src/object/mod.rs:64:8
|
64 | fn get<T: Object+DataSize>(&self, r: Ref<T>) -> Result<RcRef<T>>;
| ^^^
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 8 in examples/src/bin/form.rs
github-actions / clippy
unused import: `Log`
warning: unused import: `Log`
--> examples/src/bin/form.rs:8:30
|
8 | use pdf::file::{FileOptions, Log};
| ^^^
|
= note: `#[warn(unused_imports)]` on by default
Check warning on line 268 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:268:36
|
268 | 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 257 in pdf/src/font.rs
github-actions / clippy
accessing first element with `inner.descendant_fonts.get(0)`
warning: accessing first element with `inner.descendant_fonts.get(0)`
--> pdf/src/font.rs:257:43
|
257 | FontData::Type0(ref inner) => inner.descendant_fonts.get(0).and_then(|f| f.cid_to_gid_map()),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `inner.descendant_fonts.first()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
Check warning on line 246 in pdf/src/font.rs
github-actions / clippy
accessing first element with `t.descendant_fonts.get(0)`
warning: accessing first element with `t.descendant_fonts.get(0)`
--> pdf/src/font.rs:246:39
|
246 | FontData::Type0(ref t) => t.descendant_fonts.get(0).and_then(|f| f.embedded_data(resolve)),
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `t.descendant_fonts.first()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
Check warning on line 759 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:759:21
|
759 | 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 602 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:602:70
|
602 | 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 1236 in pdf/src/object/types.rs
github-actions / clippy
accessing first element with `array.get(0)`
warning: accessing first element with `array.get(0)`
--> pdf/src/object/types.rs:1236:52
|
1236 | let page = Object::from_primitive(try_opt!(array.get(0)).clone(), resolve)?;
| ^^^^^^^^^^^^ help: try: `array.first()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
= note: `#[warn(clippy::get_first)]` on by default
Check warning on line 397 in pdf/src/build.rs
github-actions / clippy
unused variable: `old`
warning: unused variable: `old`
--> pdf/src/build.rs:397:22
|
397 | 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 270 in pdf/src/primitive.rs
github-actions / clippy
unused variable: `update`
warning: unused variable: `update`
--> pdf/src/primitive.rs:270:28
|
270 | 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 766 in pdf/src/object/mod.rs
github-actions / clippy
unused variable: `cloner`
warning: unused variable: `cloner`
--> pdf/src/object/mod.rs:766:38
|
766 | fn deep_clone(&self, cloner: &mut impl Cloner) -> Result<Self> {
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_cloner`
...
773 | deep_clone_simple!(f32, i32, u32, bool, Name, (), Date, PdfString, Rectangle, 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 766 in pdf/src/object/mod.rs
github-actions / clippy
unused variable: `cloner`
warning: unused variable: `cloner`
--> pdf/src/object/mod.rs:766:38
|
766 | fn deep_clone(&self, cloner: &mut impl Cloner) -> Result<Self> {
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_cloner`
...
773 | deep_clone_simple!(f32, i32, u32, bool, Name, (), Date, PdfString, Rectangle, 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 766 in pdf/src/object/mod.rs
github-actions / clippy
unused variable: `cloner`
warning: unused variable: `cloner`
--> pdf/src/object/mod.rs:766:38
|
766 | fn deep_clone(&self, cloner: &mut impl Cloner) -> Result<Self> {
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_cloner`
...
773 | deep_clone_simple!(f32, i32, u32, bool, Name, (), Date, PdfString, Rectangle, 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 766 in pdf/src/object/mod.rs
github-actions / clippy
unused variable: `cloner`
warning: unused variable: `cloner`
--> pdf/src/object/mod.rs:766:38
|
766 | fn deep_clone(&self, cloner: &mut impl Cloner) -> Result<Self> {
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_cloner`
...
773 | deep_clone_simple!(f32, i32, u32, bool, Name, (), Date, PdfString, Rectangle, 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 766 in pdf/src/object/mod.rs
github-actions / clippy
unused variable: `cloner`
warning: unused variable: `cloner`
--> pdf/src/object/mod.rs:766:38
|
766 | fn deep_clone(&self, cloner: &mut impl Cloner) -> Result<Self> {
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_cloner`
...
773 | deep_clone_simple!(f32, i32, u32, bool, Name, (), Date, PdfString, Rectangle, 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 766 in pdf/src/object/mod.rs
github-actions / clippy
unused variable: `cloner`
warning: unused variable: `cloner`
--> pdf/src/object/mod.rs:766:38
|
766 | fn deep_clone(&self, cloner: &mut impl Cloner) -> Result<Self> {
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_cloner`
...
773 | deep_clone_simple!(f32, i32, u32, bool, Name, (), Date, PdfString, Rectangle, 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 766 in pdf/src/object/mod.rs
github-actions / clippy
unused variable: `cloner`
warning: unused variable: `cloner`
--> pdf/src/object/mod.rs:766:38
|
766 | fn deep_clone(&self, cloner: &mut impl Cloner) -> Result<Self> {
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_cloner`
...
773 | deep_clone_simple!(f32, i32, u32, bool, Name, (), Date, PdfString, Rectangle, 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 766 in pdf/src/object/mod.rs
github-actions / clippy
unused variable: `cloner`
warning: unused variable: `cloner`
--> pdf/src/object/mod.rs:766:38
|
766 | fn deep_clone(&self, cloner: &mut impl Cloner) -> Result<Self> {
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_cloner`
...
773 | deep_clone_simple!(f32, i32, u32, bool, Name, (), Date, PdfString, Rectangle, 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 766 in pdf/src/object/mod.rs
github-actions / clippy
unused variable: `cloner`
warning: unused variable: `cloner`
--> pdf/src/object/mod.rs:766:38
|
766 | fn deep_clone(&self, cloner: &mut impl Cloner) -> Result<Self> {
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_cloner`
...
773 | deep_clone_simple!(f32, i32, u32, bool, Name, (), Date, PdfString, Rectangle, 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 766 in pdf/src/object/mod.rs
github-actions / clippy
unused variable: `cloner`
warning: unused variable: `cloner`
--> pdf/src/object/mod.rs:766:38
|
766 | fn deep_clone(&self, cloner: &mut impl Cloner) -> Result<Self> {
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_cloner`
...
773 | deep_clone_simple!(f32, i32, u32, bool, Name, (), Date, PdfString, Rectangle, 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 766 in pdf/src/object/mod.rs
github-actions / clippy
unused variable: `cloner`
warning: unused variable: `cloner`
--> pdf/src/object/mod.rs:766:38
|
766 | fn deep_clone(&self, cloner: &mut impl Cloner) -> Result<Self> {
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_cloner`
...
773 | deep_clone_simple!(f32, i32, u32, bool, Name, (), Date, PdfString, Rectangle, 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)