fmp-rust-sdk 0.1.1

Async Rust SDK for Financial Modeling Prep with typed data, subscription awareness, and WebSocket feeds
Documentation
1
2
3
4
5
6
7
8
9
10
11
/// Removes the configured credential and common wire encodings from diagnostics.
pub(crate) fn redact(value: &str, api_key: &str) -> String {
    let escaped = serde_json::to_string(api_key).expect("a string is JSON serializable");
    let encoded: String = url::form_urlencoded::byte_serialize(api_key.as_bytes()).collect();
    let form_encoded = encoded.replace("%20", "+");
    value
        .replace(api_key, "[REDACTED]")
        .replace(&escaped[1..escaped.len() - 1], "[REDACTED]")
        .replace(&encoded, "[REDACTED]")
        .replace(&form_encoded, "[REDACTED]")
}