serde_urlencoded icon indicating copy to clipboard operation
serde_urlencoded copied to clipboard

Fix clippy recommendations and compiler warnings

Open Gisleburt opened this issue 4 years ago • 2 comments

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.

Gisleburt avatar May 11 '20 11:05 Gisleburt

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

nox avatar May 11 '20 11:05 nox

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.

Gisleburt avatar May 12 '20 09:05 Gisleburt