Skip to content

Commit 8b8d748

Browse files
authored
Merge pull request #13 from gh0st42/master
Made crate unsafe free and forbid unsafe
2 parents da77235 + 227d7e5 commit 8b8d748

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/date.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ impl fmt::Display for Rfc3339Timestamp {
356356
};
357357

358358
// we know our chars are all ascii
359-
f.write_str(unsafe { str::from_utf8_unchecked(&buf[..=offset]) })
359+
f.write_str(str::from_utf8(&buf[..=offset]).expect("Conversion to utf8 failed"))
360360
}
361361
}
362362

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
//! [serde-humantime]: https://docs.rs/serde-humantime/0.1.1/serde_humantime/
1616
//! [humantime-serde]: https://docs.rs/humantime-serde
1717
18+
#![forbid(unsafe_code)]
1819
#![warn(missing_debug_implementations)]
1920
#![warn(missing_docs)]
2021

0 commit comments

Comments
 (0)