mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +00:00
tools: run cargo fmt on pnam
Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
d15127fef6
commit
f7ae13da44
1 changed files with 6 additions and 4 deletions
|
|
@ -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])?;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue