uuid-rs / uuid

Generate and parse UUIDs.

Home Page:https://www.crates.io/crates/uuid

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Minor docs change

QnnOkabayashi opened this issue · comments

commented

We should make sure to emphasize that the macro is for string literals only, and that it parses at compile time.

So this part should be altered slightly.

uuid/src/lib.rs

Lines 60 to 66 in b98c958

//! If you have a UUID value you can use it inline:
//!
//! ```
//! use uuid::{uuid, Uuid};
//!
//! const ID: Uuid = uuid!("67e55044-10b1-426f-9247-bb680e5fe0c8");
//! ```

... to instead say:

 //! If you have a UUID value, you can use its string literal form inline:

Another way can we to have a note at the bottom warning that only string literals are accepted.

//! If you have a UUID value you can use it inline: 
 //! 
 //! ``` 
 //! use uuid::{uuid, Uuid}; 
 //! 
 //! const ID: Uuid = uuid!("67e55044-10b1-426f-9247-bb680e5fe0c8"); 
 //!
 //! __NOTE__: Only `string literal`s are accepted by the macro. If you intend on using `number literal`s, instead using `Uuid::from_u128(...);`
 //! ```