Skip to content

Commit 4a6eeba

Browse files
committed
Some refactoring
Signed-off-by: Malhar Vora <mlvora.2010@gmail.com>
1 parent c90eff3 commit 4a6eeba

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/uu/lsns/src/errors.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub enum LsnsError {
1717
/// Invalid namespace type index
1818
InvalidNamespaceType(usize),
1919
/// Unsupported platform
20-
#[allow(dead_code)]
20+
#[cfg(not(target_os = "linux"))]
2121
UnsupportedPlatform,
2222
/// Invalid namespace inode format
2323
InvalidNamespaceInodeFormat(String),
@@ -57,6 +57,7 @@ impl fmt::Display for LsnsError {
5757
Self::IOError(message, err) => write!(f, "{message}: {err}"),
5858
Self::NulError(message, err) => write!(f, "{message}: {err}"),
5959
Self::InvalidNamespaceType(idx) => write!(f, "Invalid namespace type index: {}", idx),
60+
#[cfg(not(target_os = "linux"))]
6061
Self::UnsupportedPlatform => write!(f, "lsns is only supported on Linux"),
6162
Self::InvalidNamespaceInodeFormat(s) => {
6263
write!(f, "Invalid namespace inode format: {}", s)

0 commit comments

Comments
 (0)