Skip to content

Commit

Permalink
runtime-rs: delete some allow(dead_code) attributes
Browse files Browse the repository at this point in the history
Some #![allow(dead_code)]s and code are not needed indeed.

Fixes: #5164

Signed-off-by: Bin Liu <bin@hyper.sh>
  • Loading branch information
liubin committed Sep 14, 2022
1 parent a58feba commit 156e1c3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 24 deletions.
22 changes: 0 additions & 22 deletions src/runtime-rs/crates/resource/src/rootfs/mod.rs
Expand Up @@ -11,7 +11,6 @@ use std::{sync::Arc, vec::Vec};
use anyhow::{anyhow, Context, Result};
use async_trait::async_trait;
use kata_types::mount::Mount;
use nix::sys::stat::{self, SFlag};
use tokio::sync::RwLock;

use crate::share_fs::ShareFs;
Expand Down Expand Up @@ -98,24 +97,3 @@ impl RootFsResource {
fn is_single_layer_rootfs(rootfs_mounts: &[Mount]) -> bool {
rootfs_mounts.len() == 1
}

#[allow(dead_code)]
fn get_block_device(file_path: &str) -> Option<u64> {
if file_path.is_empty() {
return None;
}

match stat::stat(file_path) {
Ok(fstat) => {
if SFlag::from_bits_truncate(fstat.st_mode) == SFlag::S_IFBLK {
return Some(fstat.st_rdev);
}
}
Err(err) => {
error!(sl!(), "failed to stat for {} {:?}", file_path, err);
return None;
}
};

None
}
2 changes: 0 additions & 2 deletions src/runtime-rs/crates/shim/src/config.rs.in
Expand Up @@ -7,8 +7,6 @@
// WARNING: This file is auto-generated - DO NOT EDIT!
//

#![allow(dead_code)]

pub const PROJECT_NAME: &str = "@PROJECT_NAME@";
pub const RUNTIME_VERSION: &str = "@RUNTIME_VERSION@";
pub const RUNTIME_VERSION_COMMIT: &str = "@VERSION_COMMIT@";
Expand Down

0 comments on commit 156e1c3

Please sign in to comment.