Macro swhid

Source
macro_rules! swhid {
    (swh:1:cnt:$hash:literal) => { ... };
    (swh:1:dir:$hash:literal) => { ... };
    (swh:1:rev:$hash:literal) => { ... };
    (swh:1:rel:$hash:literal) => { ... };
    (swh:1:snp:$hash:literal) => { ... };
    (swh:1:ori:$hash:literal) => { ... };
}
Expand description

A SWHID literal checked at compile time

§Examples

use swh_graph::swhid;
assert_eq!(
    swhid!(swh:1:rev:0000000000000000000000000000000000000004).to_string(),
    "swh:1:rev:0000000000000000000000000000000000000004".to_string(),
);
use swh_graph::swhid;
swhid!(swh:1:rev:ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ);
use swh_graph::swhid;
swhid!(swh:1:rev:00000000000000000000000000000000000004);