mirror of
https://gitee.com/openharmony/third_party_rust_humantime
synced 2024-11-27 01:30:57 +00:00
Made crate unsafe free and forbid unsafe
This commit is contained in:
parent
4a40682595
commit
227d7e591d
@ -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"))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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)]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user