filthy-rich 0.10.0

Tiny, ergonomic Discord Rich Presence library for your Rust apps.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use anyhow::Result;

pub fn get_current_timestamp() -> Result<u64> {
    Ok(std::time::SystemTime::now()
        .duration_since(std::time::UNIX_EPOCH)?
        .as_secs())
}

pub fn filter_none_string(text: impl Into<String>) -> Option<String> {
    let text: String = text.into();

    if !text.is_empty() { Some(text) } else { None }
}