Replace from/into with get/new when necessary.
This commit is contained in:
+2
-2
@@ -554,7 +554,7 @@ impl Scheme for ProcScheme {
|
||||
} else if self.access == Access::Restricted {
|
||||
return Err(Error::new(EACCES));
|
||||
} else {
|
||||
ContextId::from(pid_str.parse().map_err(|_| Error::new(ENOENT))?)
|
||||
ContextId::new(pid_str.parse().map_err(|_| Error::new(ENOENT))?)
|
||||
};
|
||||
|
||||
self.open_inner(pid, parts.next(), flags, uid, gid)
|
||||
@@ -1096,7 +1096,7 @@ impl KernelScheme for ProcScheme {
|
||||
let handles = self.handles.read();
|
||||
let handle = handles.get(&id).ok_or(Error::new(EBADF))?;
|
||||
|
||||
let path = format!("proc:{}/{}", handle.info.pid.into(), match handle.info.operation {
|
||||
let path = format!("proc:{}/{}", handle.info.pid.get(), match handle.info.operation {
|
||||
Operation::Regs(RegsKind::Float) => "regs/float",
|
||||
Operation::Regs(RegsKind::Int) => "regs/int",
|
||||
Operation::Regs(RegsKind::Env) => "regs/env",
|
||||
|
||||
@@ -100,15 +100,15 @@ pub fn resource() -> Result<Vec<u8>> {
|
||||
};
|
||||
|
||||
string.push_str(&format!("{:<6}{:<6}{:<6}{:<6}{:<6}{:<6}{:<6}{:<6}{:<6}{:<6}{:<6}{:<6}{:<12}{:<8}{}\n",
|
||||
context.id.into(),
|
||||
context.pgid.into(),
|
||||
context.ppid.into(),
|
||||
context.id.get(),
|
||||
context.pgid.get(),
|
||||
context.ppid.get(),
|
||||
context.ruid,
|
||||
context.rgid,
|
||||
context.rns.into(),
|
||||
context.rns.get(),
|
||||
context.euid,
|
||||
context.egid,
|
||||
context.ens.into(),
|
||||
context.ens.get(),
|
||||
stat_string,
|
||||
cpu_string,
|
||||
affinity,
|
||||
|
||||
@@ -38,7 +38,7 @@ pub fn resource() -> Result<Vec<u8>> {
|
||||
match schemes.get(description.scheme) {
|
||||
Some(scheme) => scheme.clone(),
|
||||
None => {
|
||||
let _ = writeln!(string, " {:>4}: {:>8} {:>8} {:>08X}: no scheme", fd, description.scheme.into(), description.number, description.flags);
|
||||
let _ = writeln!(string, " {:>4}: {:>8} {:>8} {:>08X}: no scheme", fd, description.scheme.get(), description.number, description.flags);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -48,10 +48,10 @@ pub fn resource() -> Result<Vec<u8>> {
|
||||
match scheme.fpath(description.number, &mut fpath) {
|
||||
Ok(path_len) => {
|
||||
let fname = str::from_utf8(&fpath[..path_len]).unwrap_or("?");
|
||||
let _ = writeln!(string, "{:>6}: {:>8} {:>8} {:>08X}: {}", fd, description.scheme.into(), description.number, description.flags, fname);
|
||||
let _ = writeln!(string, "{:>6}: {:>8} {:>8} {:>08X}: {}", fd, description.scheme.get(), description.number, description.flags, fname);
|
||||
},
|
||||
Err(err) => {
|
||||
let _ = writeln!(string, "{:>6}: {:>8} {:>8} {:>08X}: {}", fd, description.scheme.into(), description.number, description.flags, err);
|
||||
let _ = writeln!(string, "{:>6}: {:>8} {:>8} {:>08X}: {}", fd, description.scheme.get(), description.number, description.flags, err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ pub fn resource() -> Result<Vec<u8>> {
|
||||
|
||||
let schemes = scheme::schemes();
|
||||
for (name, &scheme_id) in schemes.iter_name(scheme_ns) {
|
||||
data.extend_from_slice(format!("{:>4}: ", scheme_id.into()).as_bytes());
|
||||
data.extend_from_slice(format!("{:>4}: ", scheme_id.get()).as_bytes());
|
||||
data.extend_from_slice(name.as_bytes());
|
||||
data.push(b'\n');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user