vmm: Address Rust 1.51.0 clippy issue (needless_question_mark)
warning: Question mark operator is useless here
--> vmm/src/seccomp_filters.rs:493:5
|
493 | / Ok(SeccompFilter::new(
494 | | rules.into_iter().collect(),
495 | | SeccompAction::Trap,
496 | | )?)
| |_______^
|
= note: `#[warn(clippy::needless_question_mark)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
help: try
|
493 | SeccompFilter::new(
494 | rules.into_iter().collect(),
495 | SeccompAction::Trap,
496 | )
|
warning: Question mark operator is useless here
--> vmm/src/seccomp_filters.rs:507:5
|
507 | / Ok(SeccompFilter::new(
508 | | rules.into_iter().collect(),
509 | | SeccompAction::Log,
510 | | )?)
| |_______^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
help: try
|
507 | SeccompFilter::new(
508 | rules.into_iter().collect(),
509 | SeccompAction::Log,
510 | )
|
warning: Question mark operator is useless here
--> vmm/src/vm.rs:887:9
|
887 | Ok(CString::new(cmdline).map_err(Error::CmdLineCString)?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `CString::new(cmdline).map_err(Error::CmdLineCString)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
19c5e91b6e
commit
7c302373ed
2 changed files with 3 additions and 9 deletions
|
|
@ -490,10 +490,7 @@ fn get_seccomp_filter_trap(thread_type: Thread) -> Result<SeccompFilter, Error>
|
|||
Thread::Vmm => vmm_thread_rules()?,
|
||||
};
|
||||
|
||||
Ok(SeccompFilter::new(
|
||||
rules.into_iter().collect(),
|
||||
SeccompAction::Trap,
|
||||
)?)
|
||||
SeccompFilter::new(rules.into_iter().collect(), SeccompAction::Trap)
|
||||
}
|
||||
|
||||
fn get_seccomp_filter_log(thread_type: Thread) -> Result<SeccompFilter, Error> {
|
||||
|
|
@ -504,10 +501,7 @@ fn get_seccomp_filter_log(thread_type: Thread) -> Result<SeccompFilter, Error> {
|
|||
Thread::Vmm => vmm_thread_rules()?,
|
||||
};
|
||||
|
||||
Ok(SeccompFilter::new(
|
||||
rules.into_iter().collect(),
|
||||
SeccompAction::Log,
|
||||
)?)
|
||||
SeccompFilter::new(rules.into_iter().collect(), SeccompAction::Log)
|
||||
}
|
||||
|
||||
/// Generate a BPF program based on the seccomp_action value
|
||||
|
|
|
|||
|
|
@ -884,7 +884,7 @@ impl Vm {
|
|||
for entry in self.device_manager.lock().unwrap().cmdline_additions() {
|
||||
cmdline.insert_str(entry).map_err(Error::CmdLineInsertStr)?;
|
||||
}
|
||||
Ok(CString::new(cmdline).map_err(Error::CmdLineCString)?)
|
||||
CString::new(cmdline).map_err(Error::CmdLineCString)
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue