Made crate unsafe free and forbid unsafe

This commit is contained in:
gh0st 2020-01-18 20:07:02 +01:00
parent 4a40682595
commit 227d7e591d
2 changed files with 2 additions and 1 deletions

View File

@ -356,7 +356,7 @@ impl fmt::Display for Rfc3339Timestamp {
};
// we know our chars are all ascii
f.write_str(unsafe { str::from_utf8_unchecked(&buf[..=offset]) })
f.write_str(str::from_utf8(&buf[..=offset]).expect("Conversion to utf8 failed"))
}
}

View File

@ -15,6 +15,7 @@
//! [serde-humantime]: https://docs.rs/serde-humantime/0.1.1/serde_humantime/
//! [humantime-serde]: https://docs.rs/humantime-serde
#![forbid(unsafe_code)]
#![warn(missing_debug_implementations)]
#![warn(missing_docs)]