pushover 0.4.0

A wrapper for the Pushover API.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use serde::de::{Deserialize, Deserializer};

pub fn deserialize_option_empty_string<'de, D>(deserializer: D) -> Result<Option<String>, D::Error>
where
    D: Deserializer<'de>,
{
    let result: Option<String> = Deserialize::deserialize(deserializer)?;

    match result {
        Some(ref x) if x == "" => Ok(None),
        _ => Ok(result),
    }
}