Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-Authored-By: Hunar Roop Kahlon <[email protected]>
  • Loading branch information
ammgws and kinggoesgaming authored Jan 21, 2020
1 parent cc9e6ac commit 4899012
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ To create a new random (V4) UUID and print it out in hexadecimal form:
use uuid::Uuid;

fn main() -> Result<(), Box<std::error::Error> {
let my_uuid = Uuid::new_v4().unwrap();
let my_uuid = Uuid::new_v4()?;
println!("{}", my_uuid);
}
```
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@
//!
//! use uuid::Uuid;
//!
//! fn main() {
//! let my_uuid = Uuid::new_v4().unwrap();
//! fn main() -> Result<(), Box<std::error::Error> {
//! let my_uuid = Uuid::new_v4()?;
//! println!("{}", my_uuid);
//! }
//! ```
Expand Down
1 change: 1 addition & 0 deletions src/v4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ impl Uuid {
///
/// [`getrandom`]: https://crates.io/crates/getrandom
/// [`rand`]: https://crates.io/crates/rand
// TODO: change signature to support uuid's Error.
pub fn new_v4() -> Result<Uuid, getrandom::Error> {
let mut bytes = [0u8; 16];
getrandom::getrandom(&mut bytes)?;
Expand Down

0 comments on commit 4899012

Please sign in to comment.