mirror of
https://github.com/serde-rs/json.git
synced 2026-03-05 05:19:08 +00:00
Downgrade some unnecessary runtime asserts to debug_assert
This commit is contained in:
parent
eb383c08b2
commit
6ca3752e9d
@ -470,7 +470,7 @@ where
|
||||
F: Formatter,
|
||||
{
|
||||
fn write_str(&mut self, s: &str) -> fmt::Result {
|
||||
assert!(self.error.is_none());
|
||||
debug_assert!(self.error.is_none());
|
||||
match format_escaped_str_contents(self.writer, self.formatter, s) {
|
||||
Ok(()) => Ok(()),
|
||||
Err(err) => {
|
||||
@ -492,7 +492,7 @@ where
|
||||
error: None,
|
||||
};
|
||||
match write!(adapter, "{}", value) {
|
||||
Ok(()) => assert!(adapter.error.is_none()),
|
||||
Ok(()) => debug_assert!(adapter.error.is_none()),
|
||||
Err(fmt::Error) => {
|
||||
return Err(Error::io(adapter.error.expect("there should be an error")));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user