Skip to content

Commit

Permalink
Merge pull request #13 from gh0st42/master
Browse files Browse the repository at this point in the history
Made crate unsafe free and forbid unsafe
  • Loading branch information
tailhook authored Jan 19, 2020
2 parents da77235 + 227d7e5 commit 8b8d748
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
}
}

Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]

Expand Down

0 comments on commit 8b8d748

Please sign in to comment.