Run `cargo fmt`
This commit is contained in:
parent
c837a13121
commit
d5c98510db
|
@ -8,7 +8,7 @@ pub struct ResourceRequest {
|
|||
resource_types: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize,PartialEq,Debug)]
|
||||
#[derive(Deserialize, PartialEq, Debug)]
|
||||
pub struct Resource {
|
||||
r#type: String,
|
||||
blocked_in: HashMap<String, bool>,
|
||||
|
@ -16,18 +16,18 @@ pub struct Resource {
|
|||
address: String,
|
||||
port: u16,
|
||||
fingerprint: String,
|
||||
#[serde(rename="or-addresses")]
|
||||
#[serde(rename = "or-addresses")]
|
||||
or_addresses: Option<Vec<String>>,
|
||||
distribution: String,
|
||||
flags: Option<HashMap<String,bool>>,
|
||||
params: Option<HashMap<String,String>>,
|
||||
flags: Option<HashMap<String, bool>>,
|
||||
params: Option<HashMap<String, String>>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct ResourceDiff {
|
||||
new: Option<HashMap<String,Vec<Resource>>>,
|
||||
changed: Option<HashMap<String,Vec<Resource>>>,
|
||||
gone: Option<HashMap<String,Vec<Resource>>>,
|
||||
new: Option<HashMap<String, Vec<Resource>>>,
|
||||
changed: Option<HashMap<String, Vec<Resource>>>,
|
||||
gone: Option<HashMap<String, Vec<Resource>>>,
|
||||
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(),
|
||||
|
|
Loading…
Reference in New Issue