Skip to content

various

various #141

GitHub Actions / clippy failed Dec 2, 2023 in 0s

clippy

4 errors, 37 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 4
Warning 37
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 failure on line 79 in examples/src/bin/extract_page.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the method `info` exists for struct `PdfBuilder<Arc<SyncCache<PlainRef, Result<AnySync, Arc<PdfError>>>>, Arc<SyncCache<PlainRef, ...>>, ...>`, but its trait bounds were not satisfied

error[E0599]: the method `info` exists for struct `PdfBuilder<Arc<SyncCache<PlainRef, Result<AnySync, Arc<PdfError>>>>, Arc<SyncCache<PlainRef, ...>>, ...>`, but its trait bounds were not satisfied
  --> examples/src/bin/extract_page.rs:79:24
   |
79 |       let data = builder.info(info).build(catalog)?;
   |                          ^^^^------ help: remove the arguments
   |                          |
   |                          field, not a method
  --> /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/alloc/src/sync.rs:248:1
  ::: /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/alloc/src/sync.rs:251:1
   |
   = note: doesn't satisfy `_: Default`
   |
   = note: the full type name has been written to '/home/runner/work/pdf/pdf/target/debug/deps/extract_page-37ed76305e7bcef0.long-type-17260234671508407243.txt'
   = note: the following trait bounds were not satisfied:
           `std::sync::Arc<pdf::file::SyncCache<pdf::object::PlainRef, std::result::Result<pdf::any::AnySync, std::sync::Arc<pdf::PdfError>>>>: std::default::Default`
           `std::sync::Arc<pdf::file::SyncCache<pdf::object::PlainRef, std::result::Result<std::sync::Arc<[u8]>, std::sync::Arc<pdf::PdfError>>>>: std::default::Default`

Check failure on line 35 in examples/src/bin/extract_page.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the trait bound `std::result::Result<std::sync::Arc<[u8]>, std::sync::Arc<pdf::PdfError>>: std::default::Default` is not satisfied

error[E0277]: the trait bound `std::result::Result<std::sync::Arc<[u8]>, std::sync::Arc<pdf::PdfError>>: std::default::Default` is not satisfied
   --> examples/src/bin/extract_page.rs:35:39
    |
35  |     let mut builder = PdfBuilder::new(FileOptions::cached());
    |                       --------------- ^^^^^^^^^^^^^^^^^^^^^ the trait `std::default::Default` is not implemented for `std::result::Result<std::sync::Arc<[u8]>, std::sync::Arc<pdf::PdfError>>`
    |                       |
    |                       required by a bound introduced by this call
    |
    = help: the trait `std::default::Default` is implemented for `std::sync::Arc<T>`
    = note: required for `pdf::file::SyncCache<pdf::object::PlainRef, std::result::Result<std::sync::Arc<[u8]>, std::sync::Arc<pdf::PdfError>>>` to implement `std::default::Default`
    = note: 1 redundant requirement hidden
    = note: required for `std::sync::Arc<pdf::file::SyncCache<pdf::object::PlainRef, std::result::Result<std::sync::Arc<[u8]>, std::sync::Arc<pdf::PdfError>>>>` to implement `std::default::Default`
note: required by a bound in `pdf::build::PdfBuilder::<SC, OC, L>::new`
   --> /home/runner/work/pdf/pdf/pdf/src/build.rs:161:51
    |
161 |     OC: Cache<Result<Arc<[u8]>, Arc<PdfError>>> + Default,
    |                                                   ^^^^^^^ required by this bound in `PdfBuilder::<SC, OC, L>::new`
...
164 |     pub fn new(fileoptions: FileOptions<'_, SC, OC, L>) -> Self {
    |            --- required by a bound in this associated function

Check failure on line 35 in examples/src/bin/extract_page.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the trait bound `std::result::Result<pdf::any::AnySync, std::sync::Arc<pdf::PdfError>>: std::default::Default` is not satisfied

error[E0277]: the trait bound `std::result::Result<pdf::any::AnySync, std::sync::Arc<pdf::PdfError>>: std::default::Default` is not satisfied
   --> examples/src/bin/extract_page.rs:35:39
    |
35  |     let mut builder = PdfBuilder::new(FileOptions::cached());
    |                       --------------- ^^^^^^^^^^^^^^^^^^^^^ the trait `std::default::Default` is not implemented for `std::result::Result<pdf::any::AnySync, std::sync::Arc<pdf::PdfError>>`
    |                       |
    |                       required by a bound introduced by this call
    |
    = help: the trait `std::default::Default` is implemented for `std::sync::Arc<T>`
    = note: required for `pdf::file::SyncCache<pdf::object::PlainRef, std::result::Result<pdf::any::AnySync, std::sync::Arc<pdf::PdfError>>>` to implement `std::default::Default`
    = note: 1 redundant requirement hidden
    = note: required for `std::sync::Arc<pdf::file::SyncCache<pdf::object::PlainRef, std::result::Result<pdf::any::AnySync, std::sync::Arc<pdf::PdfError>>>>` to implement `std::default::Default`
note: required by a bound in `pdf::build::PdfBuilder::<SC, OC, L>::new`
   --> /home/runner/work/pdf/pdf/pdf/src/build.rs:160:49
    |
160 |     SC: Cache<Result<AnySync, Arc<PdfError>>> + Default,
    |                                                 ^^^^^^^ required by this bound in `PdfBuilder::<SC, OC, L>::new`
...
164 |     pub fn new(fileoptions: FileOptions<'_, SC, OC, L>) -> Self {
    |            --- required by a bound in this associated function

Check failure on line 35 in examples/src/bin/extract_page.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the trait bound `pdf::object::PlainRef: std::default::Default` is not satisfied

error[E0277]: the trait bound `pdf::object::PlainRef: std::default::Default` is not satisfied
   --> examples/src/bin/extract_page.rs:35:39
    |
35  |     let mut builder = PdfBuilder::new(FileOptions::cached());
    |                       --------------- ^^^^^^^^^^^^^^^^^^^^^ the trait `std::default::Default` is not implemented for `pdf::object::PlainRef`
    |                       |
    |                       required by a bound introduced by this call
    |
    = help: the trait `std::default::Default` is implemented for `std::sync::Arc<T>`
    = note: required for `pdf::file::SyncCache<pdf::object::PlainRef, std::result::Result<pdf::any::AnySync, std::sync::Arc<pdf::PdfError>>>` to implement `std::default::Default`
    = note: 1 redundant requirement hidden
    = note: required for `std::sync::Arc<pdf::file::SyncCache<pdf::object::PlainRef, std::result::Result<pdf::any::AnySync, std::sync::Arc<pdf::PdfError>>>>` to implement `std::default::Default`
note: required by a bound in `pdf::build::PdfBuilder::<SC, OC, L>::new`
   --> /home/runner/work/pdf/pdf/pdf/src/build.rs:160:49
    |
160 |     SC: Cache<Result<AnySync, Arc<PdfError>>> + Default,
    |                                                 ^^^^^^^ required by this bound in `PdfBuilder::<SC, OC, L>::new`
...
164 |     pub fn new(fileoptions: FileOptions<'_, SC, OC, L>) -> Self {
    |            --- required by a bound in this associated function

Check warning on line 267 in pdf/src/build.rs

See this annotation in the file changed.

@github-actions 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 759 in pdf/src/object/mod.rs

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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 396 in pdf/src/build.rs

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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 766 in pdf/src/object/mod.rs

See this annotation in the file changed.

@github-actions 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, 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 766 in pdf/src/object/mod.rs

See this annotation in the file changed.

@github-actions 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, 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 766 in pdf/src/object/mod.rs

See this annotation in the file changed.

@github-actions 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, 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 766 in pdf/src/object/mod.rs

See this annotation in the file changed.

@github-actions 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, 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 766 in pdf/src/object/mod.rs

See this annotation in the file changed.

@github-actions 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, 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 766 in pdf/src/object/mod.rs

See this annotation in the file changed.

@github-actions 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, 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 766 in pdf/src/object/mod.rs

See this annotation in the file changed.

@github-actions 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, 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 766 in pdf/src/object/mod.rs

See this annotation in the file changed.

@github-actions 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, 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 766 in pdf/src/object/mod.rs

See this annotation in the file changed.

@github-actions 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, 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 766 in pdf/src/object/mod.rs

See this annotation in the file changed.

@github-actions 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, 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 766 in pdf/src/object/mod.rs

See this annotation in the file changed.

@github-actions 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, 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 766 in pdf/src/object/mod.rs

See this annotation in the file changed.

@github-actions 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, 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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`