From f7ae13da448aca77473120189d398b239e8d001e Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Wed, 19 May 2021 14:20:22 +0800 Subject: [PATCH] tools: run `cargo fmt` on pnam Signed-off-by: Sean Cross --- tools/src/tags/pnam.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/src/tags/pnam.rs b/tools/src/tags/pnam.rs index bc062152f..86f6ee208 100644 --- a/tools/src/tags/pnam.rs +++ b/tools/src/tags/pnam.rs @@ -1,7 +1,7 @@ use crate::xous_arguments::{XousArgument, XousArgumentCode, XousSize}; +use std::collections::BTreeMap; use std::fmt; use std::io; -use std::collections::BTreeMap; #[derive(Debug)] pub struct ProcessNames { @@ -21,7 +21,9 @@ impl fmt::Display for ProcessNames { impl ProcessNames { pub fn new() -> ProcessNames { - ProcessNames { names: BTreeMap::new() } + ProcessNames { + names: BTreeMap::new(), + } } pub fn set(&mut self, pid: u32, name: &str) { @@ -41,7 +43,7 @@ impl XousArgument for ProcessNames { size += 4; size += val.len(); // Pad it to 4-bytes - size += (4-(val.len() & 3))&3; + size += (4 - (val.len() & 3)) & 3; } size as XousSize } @@ -54,7 +56,7 @@ impl XousArgument for ProcessNames { written += output.write(name.as_bytes())?; // Pad it to 4-bytes - for _ in 0..(4-(name.len() & 3))&3 { + for _ in 0..(4 - (name.len() & 3)) & 3 { written += output.write(&[0])?; } }