use short_id::{id, short_id, ShortId};
#[cfg(feature = "std")]
use short_id::{ordered_id, short_id_ordered};
fn main() {
println!("=== Functions ===");
let random_id = short_id();
println!("short_id(): {random_id}");
#[cfg(feature = "std")]
{
let ordered = short_id_ordered();
println!("short_id_ordered(): {ordered}");
}
println!("\n=== Macros ===");
let macro_id = id!();
println!("id!(): {macro_id}");
#[cfg(feature = "std")]
{
let macro_ordered = ordered_id!();
println!("ordered_id!(): {macro_ordered}");
}
println!("\n=== Typed Wrapper ===");
let typed_random = ShortId::random();
println!("ShortId::random(): {typed_random}");
#[cfg(feature = "std")]
{
let typed_ordered = ShortId::ordered();
println!("ShortId::ordered(): {typed_ordered}");
}
let s: String = typed_random.clone().into();
println!("\nConverted to String: {s}");
println!("Using as_str(): {}", typed_random.as_str());
println!("Using AsRef<str>: {}", typed_random.as_ref());
}