Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings on rustc 1.72 #191

Merged
merged 1 commit into from
Sep 15, 2023
Merged

Fix warnings on rustc 1.72 #191

merged 1 commit into from
Sep 15, 2023

Conversation

aDotInTheVoid
Copy link
Contributor

@aDotInTheVoid aDotInTheVoid commented Sep 14, 2023

Due to #![deny(warnings)] these are needed to develop on the project with the latest release.

error: using `.deref()` on a double reference, which returns `&T` instead of dereferencing the inner type
  --> core/src/codec.rs:50:13
   |
50 |         self.deref().encode(c, w)
   |             ^^^^^^^^
   |
note: the lint level is defined here
  --> core/src/lib.rs:3:9
   |
3  | #![deny(warnings)]
   |         ^^^^^^^^
   = note: `#[deny(suspicious_double_ref_op)]` implied by `#[deny(warnings)]`
Error:   --> dag-cbor/src/cbor.rs:74:17
   |
74 |                 20 | 21 | 22 => (),
   |                 ^^^^^^^^^^^^ help: try: `20..=22`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_patterns
note: the lint level is defined here
  --> dag-cbor/src/lib.rs:3:9
   |
3  | #![deny(warnings)]
   |         ^^^^^^^^
   = note: `#[deny(clippy::manual_range_patterns)]` implied by `#[deny(warnings)]`
error: incorrect implementation of `clone` on a `Copy` type
  --> core/src/link.rs:44:29
   |
44 |       fn clone(&self) -> Self {
   |  _____________________________^
45 | |         Self {
46 | |             cid: self.cid,
47 | |             _marker: self._marker,
48 | |         }
49 | |     }
   | |_____^ help: change this to: `{ *self }`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incorrect_clone_impl_on_copy_type
   = note: `#[deny(clippy::incorrect_clone_impl_on_copy_type)]` on by default
error: use of `default` to create a unit struct
  --> dag-cbor-derive/examples/basic.rs:55:47
   |
55 |     assert_roundtrip(DagCborCodec, &UnitStruct::default(), &ipld!(null));
   |                                               ^^^^^^^^^^^ help: remove this call to `default`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs
   = note: `-D clippy::default-constructed-unit-structs` implied by `-D warnings`
error: used `unwrap()` on `Some` value
   --> core/tests/serde_deserializer.rs:534:35
    |
534 |     let ipld_some = Ipld::Integer(option_some.unwrap().into());
    |                                   ^^^^^^^^^^^^^^^^^^^^
    |
help: remove the `Some` and `unwrap()`
   --> core/tests/serde_deserializer.rs:532:35
    |
532 |     let option_some: Option<u8> = Some(58u8);
    |                                   ^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap
    = note: `-D clippy::unnecessary-literal-unwrap` implied by `-D warnings`

Copy link
Member

@vmx vmx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for this change! It looks like there's one linting issue left as the CI indicates. Would you mind having a look at that as well?

Copy link
Member

@vmx vmx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@vmx vmx merged commit d321dcc into ipld:master Sep 15, 2023
10 checks passed
@aDotInTheVoid aDotInTheVoid deleted the double-refef branch September 15, 2023 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants