Crates.io | show-option |
lib.rs | show-option |
version | 0.1.0 |
source | src |
created_at | 2023-09-07 03:41:21.927535 |
updated_at | 2023-09-07 03:41:21.927535 |
description | Library for displaying Options |
homepage | https://github.com/kriomant/show-option |
repository | https://github.com/kriomant/show-option.git |
max_upload_size | |
id | 965852 |
size | 15,416 |
Rust library for diplaying Option
s.
use show_option::prelude::*;
println!("received bytes: {}", None::<usize>.show_or("none")); // "received bytes: none"
println!("amount: {}", Some(20).show_prefixed_or("$", "-")); // "amount: $20"
println!("amount: {}", format_option!(Some(20), "${}", "-")); // "amount: $20"