Skip to content

Fix clippy recommendations and compiler warnings#71

Open
Gisleburt wants to merge 5 commits intonox:masterfrom
Gisleburt:clippy
Open

Fix clippy recommendations and compiler warnings#71
Gisleburt wants to merge 5 commits intonox:masterfrom
Gisleburt:clippy

Conversation

@Gisleburt
Copy link

Implemented some clippy recommendations and fixed a few compiler warnings.

The two compiler warnings I left are

warning: use of deprecated item 'std::error::Error::description': use the Display impl or to_string()
  --> src/ser/mod.rs:78:37
   |
78 |             Error::Utf8(ref err) => error::Error::description(err),
   |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(deprecated)]` on by default

I'm not sure how to fix this without changing the function return (currently &str) since, to my knowledge, there's no other way to access the description as a reference to self.

warning: trait objects without an explicit `dyn` are deprecated
  --> src/ser/mod.rs:83:32
   |
83 |     fn cause(&self) -> Option<&error::Error> {
   |                                ^^^^^^^^^^^^ help: use `dyn`: `dyn error::Error`
   |
   = note: `#[warn(bare_trait_objects)]` on by default

This is fixed in #70 so I didn't want to create a conflict.

@nox
Copy link
Owner

nox commented May 11, 2020

Could you add 2 allows for the 2 remaining warnings please?

@Gisleburt
Copy link
Author

I've added an allow onto the deprecated description, and popped the dyn in as it seems likely this PR will go in before #70 so I can do a proper job here and update #70 after this has been merged.

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