diff --git a/crates/rdsys-backend/src/lib.rs b/crates/rdsys-backend/src/lib.rs index 8900381..459eb46 100644 --- a/crates/rdsys-backend/src/lib.rs +++ b/crates/rdsys-backend/src/lib.rs @@ -8,7 +8,7 @@ pub struct ResourceRequest { resource_types: Vec, } -#[derive(Deserialize,PartialEq,Debug)] +#[derive(Deserialize, PartialEq, Debug)] pub struct Resource { r#type: String, blocked_in: HashMap, @@ -16,18 +16,18 @@ pub struct Resource { address: String, port: u16, fingerprint: String, - #[serde(rename="or-addresses")] + #[serde(rename = "or-addresses")] or_addresses: Option>, distribution: String, - flags: Option>, - params: Option>, + flags: Option>, + params: Option>, } #[derive(Deserialize)] pub struct ResourceDiff { - new: Option>>, - changed: Option>>, - gone: Option>>, + new: Option>>, + changed: Option>>, + gone: Option>>, full_update: bool, } @@ -42,7 +42,10 @@ mod tests { resource_types: vec![String::from("obfs2"), String::from("scramblesuit")], }; let json = serde_json::to_string(&req).unwrap(); - assert_eq!(json, "{\"request_origin\":\"https\",\"resource_types\":[\"obfs2\",\"scramblesuit\"]}") + assert_eq!( + json, + "{\"request_origin\":\"https\",\"resource_types\":[\"obfs2\",\"scramblesuit\"]}" + ) } #[test] @@ -51,7 +54,10 @@ mod tests { flags.insert(String::from("fast"), true); flags.insert(String::from("stable"), true); let mut params = HashMap::new(); - params.insert(String::from("password"), String::from("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567")); + params.insert( + String::from("password"), + String::from("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"), + ); let bridge = Resource { r#type: String::from("scramblesuit"), blocked_in: HashMap::new(),