summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLinus Färnstrand <linus@mullvad.net>2017-12-28 16:16:00 +0100
committerLinus Färnstrand <linus@mullvad.net>2017-12-28 16:16:00 +0100
commit272ec721ff55579dceddfbf186578cab10b808cf (patch)
tree47a7848b17de65f98f91e56a07dd6ed9642c2de1
parent40ef5effa822a2681117fdf105f091866a3351cb (diff)
parent32c54f7ca1bdf77f2339cd86476f762c2ad61927 (diff)
downloadmullvadvpn-272ec721ff55579dceddfbf186578cab10b808cf.tar.xz
mullvadvpn-272ec721ff55579dceddfbf186578cab10b808cf.zip
Merge branch 'upgrade-rustfmt'
-rwxr-xr-xformat.sh2
-rw-r--r--mullvad-cli/src/cmds/lan.rs5
-rw-r--r--mullvad-cli/src/cmds/status.rs3
-rw-r--r--mullvad-daemon/src/bin/problem-report.rs5
-rw-r--r--talpid-core/src/firewall/macos/dns.rs9
5 files changed, 10 insertions, 14 deletions
diff --git a/format.sh b/format.sh
index 767bbd4377..2ee4194fa3 100755
--- a/format.sh
+++ b/format.sh
@@ -5,7 +5,7 @@
set -u
-VERSION="0.3.2"
+VERSION="0.3.4"
CMD="rustfmt"
INSTALL_CMD="cargo install --vers $VERSION --force rustfmt-nightly"
diff --git a/mullvad-cli/src/cmds/lan.rs b/mullvad-cli/src/cmds/lan.rs
index 29ab264de2..0c0fc51d20 100644
--- a/mullvad-cli/src/cmds/lan.rs
+++ b/mullvad-cli/src/cmds/lan.rs
@@ -49,7 +49,10 @@ impl Lan {
fn get(&self) -> Result<()> {
let allow_lan: bool = rpc::call("get_allow_lan", &[] as &[u8; 0])?;
- println!("Local network sharing setting: {}", if allow_lan { "allow" } else { "block" });
+ println!(
+ "Local network sharing setting: {}",
+ if allow_lan { "allow" } else { "block" }
+ );
Ok(())
}
}
diff --git a/mullvad-cli/src/cmds/status.rs b/mullvad-cli/src/cmds/status.rs
index 7690c6d8eb..db63978798 100644
--- a/mullvad-cli/src/cmds/status.rs
+++ b/mullvad-cli/src/cmds/status.rs
@@ -33,8 +33,7 @@ impl Command for Status {
println!("Location: {}, {}", location.city, location.country);
println!(
"Position: {:.5}°N, {:.5}°W",
- location.position[0],
- location.position[1]
+ location.position[0], location.position[1]
);
let ip: IpAddr = rpc::call("get_public_ip", &[] as &[u8; 0])?;
diff --git a/mullvad-daemon/src/bin/problem-report.rs b/mullvad-daemon/src/bin/problem-report.rs
index b7324ae866..2f344a1039 100644
--- a/mullvad-daemon/src/bin/problem-report.rs
+++ b/mullvad-daemon/src/bin/problem-report.rs
@@ -259,10 +259,7 @@ impl ProblemReport {
// matches 0-255, except 127
let first_octet = format!(
"(?:{}|{}|{}|{})",
- above_250,
- above_200,
- above_100_not_127,
- above_0
+ above_250, above_200, above_100_not_127, above_0
);
// matches 0-255
diff --git a/talpid-core/src/firewall/macos/dns.rs b/talpid-core/src/firewall/macos/dns.rs
index 1843cbe9d3..60141273ae 100644
--- a/talpid-core/src/firewall/macos/dns.rs
+++ b/talpid-core/src/firewall/macos/dns.rs
@@ -243,8 +243,7 @@ fn read_all_dns(store: &SCDynamicStore) -> HashMap<ServicePath, Option<Vec<DnsSe
// Backup all "state" DNS, and all corresponding "setup" DNS even if they don't exist
if let Some(paths) = store.get_keys(STATE_PATH_PATTERN) {
for path_ptr in paths.as_untyped().iter() {
- let state_path =
- unsafe { CFString::wrap_under_get_rule(path_ptr as CFStringRef) };
+ let state_path = unsafe { CFString::wrap_under_get_rule(path_ptr as CFStringRef) };
let state_path_str = state_path.to_string();
let setup_path_str = state_to_setup_path(&state_path_str).unwrap();
let setup_path = CFString::new(&setup_path_str);
@@ -255,8 +254,7 @@ fn read_all_dns(store: &SCDynamicStore) -> HashMap<ServicePath, Option<Vec<DnsSe
// Backup all "setup" DNS not already covered
if let Some(paths) = store.get_keys(SETUP_PATH_PATTERN) {
for path_ptr in paths.as_untyped().iter() {
- let setup_path =
- unsafe { CFString::wrap_under_get_rule(path_ptr as CFStringRef) };
+ let setup_path = unsafe { CFString::wrap_under_get_rule(path_ptr as CFStringRef) };
let setup_path_str = setup_path.to_string();
if !backup.contains_key(&setup_path_str) {
backup.insert(setup_path_str, read_dns(store, setup_path));
@@ -305,8 +303,7 @@ fn parse_cf_string_array(array: CFArray) -> Option<Vec<String>> {
for string_ptr in array.iter() {
let cf_type = unsafe { CFType::wrap_under_get_rule(string_ptr) };
if cf_type.instance_of::<_, CFString>() {
- let address =
- unsafe { CFString::wrap_under_get_rule(string_ptr as CFStringRef) };
+ let address = unsafe { CFString::wrap_under_get_rule(string_ptr as CFStringRef) };
strings.push(address.to_string());
} else {
error!("DNS server entry is not a string: {:?}", cf_type);