arma-rs 1.12.1

Arma 3 Extensions in Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::{FromArma, FromArmaError, IntoArma, Value};

impl IntoArma for uuid::Uuid {
    fn to_arma(&self) -> Value {
        self.to_string().to_arma()
    }
}

impl FromArma for uuid::Uuid {
    fn from_arma(s: String) -> Result<Self, FromArmaError> {
        let s = s
            .strip_prefix('"')
            .and_then(|s| s.strip_suffix('"'))
            .unwrap_or(&s);
        Self::parse_str(s).map_err(FromArmaError::custom)
    }
}