error: consider adding a `;` to the last statement for consistent formatting
--> src/map.rs:55:9
|
55 | self.map.clear()
| ^^^^^^^^^^^^^^^^ help: add a `;` here: `self.map.clear();`
|
note: the lint level is defined here
--> src/lib.rs:304:22
|
304 | #![deny(clippy::all, clippy::pedantic)]
| ^^^^^^^^^^^^^^^^
= note: `#[deny(clippy::semicolon_if_nothing_returned)]` implied by `#[deny(clippy::pedantic)]`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
error: consider adding a `;` to the last statement for consistent formatting
--> src/read.rs:719:9
|
719 | R::discard(self)
| ^^^^^^^^^^^^^^^^ help: add a `;` here: `R::discard(self);`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
error: consider adding a `;` to the last statement for consistent formatting
--> src/read.rs:769:9
|
769 | R::set_failed(self, failed)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `R::set_failed(self, failed);`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
error: all if blocks contain the same code at the start
--> src/ser.rs:319:9
|
319 | / if len == Some(0) {
320 | | tri!(self
321 | | .formatter
322 | | .begin_array(&mut self.writer)
323 | | .map_err(Error::io));
| |_____________________________________^
|
note: the lint level is defined here
--> src/lib.rs:304:9
|
304 | #![deny(clippy::all, clippy::pedantic)]
| ^^^^^^^^^^^
= note: `#[deny(clippy::branches_sharing_code)]` implied by `#[deny(clippy::all)]`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#branches_sharing_code
help: consider moving the start statements out like this
|
319 | tri!(self
320 | .formatter
321 | .begin_array(&mut self.writer)
322 | .map_err(Error::io));
323 | if len == Some(0) {
|
error: all if blocks contain the same code at the start
--> src/ser.rs:388:9
|
388 | / if len == Some(0) {
389 | | tri!(self
390 | | .formatter
391 | | .begin_object(&mut self.writer)
392 | | .map_err(Error::io));
| |_____________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#branches_sharing_code
help: consider moving the start statements out like this
|
388 | tri!(self
389 | .formatter
390 | .begin_object(&mut self.writer)
391 | .map_err(Error::io));
392 | if len == Some(0) {
|
`WriterFormatter` has been moved into it's own little module to enforce using it's `new` method to convey the unsafe requirements.
the safety requirements that the serializer only emits valid utf8 is already assumed by the existing `to_string` methods.
this speeds up formatting large `Value`s by about 33% in my testing
This seem to be what is now expected on stable; as the compiler warnings are saying; and also consistent with what `read_user_from_stream` example is using.