Debian Codegraph @

third_party/rust/uuid/examples/uuid_macro.rs

raw
1 //! Using the `uuid!` macro.
2 //!
3 //! `uuid!` will parse encoded UUIDs at compile time instead of at runtime.
4 //! If you've got a fixed UUID string handy then consider using `uuid!` instead
5 //! of `Uuid::parse_str` or `str::parse`.
6 //!
7 //! If you enable the `macro-diagnostics` feature, you can see much better
8 //! error messages.
9
10 #[test]
11 fn parse_uuid_at_compile_time() {
12 use uuid::uuid;
13
14 let uuid = uuid!("67e55044-10b1-426f-9247-bb680e5fe0c8");
15
16 assert_eq!(Some(uuid::Version::Random), uuid.get_version());
17 }
18
19 fn main() {}