mirror of
https://github.com/openharmony/third_party_rust_humantime.git
synced 2026-07-01 21:14:06 -04:00
Merge pull request #13 from gh0st42/master
Made crate unsafe free and forbid unsafe
This commit is contained in:
+1
-1
@@ -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)]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user