mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-31 15:25:26 +00:00
agent: Fix clippy partialeq_to_none
Fix `partialeq_to_none` clippy warning as suggested by rust 1.85.1. ```console warning: binary comparison to literal `Option::None` --> src/sandbox.rs:431:16 | 431 | if src_ctrs.get(&shared_mount.src_ctr) == None { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `src_ctrs.get(&shared_mount.src_ctr).is_none()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none ``` Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
This commit is contained in:
parent
95dca31ecc
commit
54ec432178
@ -428,7 +428,7 @@ impl Sandbox {
|
|||||||
pub fn setup_shared_mounts(&self, c: &LinuxContainer, mounts: &Vec<SharedMount>) -> Result<()> {
|
pub fn setup_shared_mounts(&self, c: &LinuxContainer, mounts: &Vec<SharedMount>) -> Result<()> {
|
||||||
let mut src_ctrs: HashMap<String, i32> = HashMap::new();
|
let mut src_ctrs: HashMap<String, i32> = HashMap::new();
|
||||||
for shared_mount in mounts {
|
for shared_mount in mounts {
|
||||||
if src_ctrs.get(&shared_mount.src_ctr) == None {
|
if src_ctrs.get(&shared_mount.src_ctr).is_none() {
|
||||||
if let Some(c) = self.find_container_by_name(&shared_mount.src_ctr) {
|
if let Some(c) = self.find_container_by_name(&shared_mount.src_ctr) {
|
||||||
src_ctrs.insert(shared_mount.src_ctr.clone(), c.init_process_pid);
|
src_ctrs.insert(shared_mount.src_ctr.clone(), c.init_process_pid);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user