From dfb9fa01593600d2f283c855215310bf8292fcf9 Mon Sep 17 00:00:00 2001 From: Krysztal112233 Date: Sat, 13 Apr 2024 15:57:37 +0800 Subject: [PATCH] slabinfo: change `SlabInfo` from pub to pub(crate) --- src/uu/slabtop/src/parse.rs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/uu/slabtop/src/parse.rs b/src/uu/slabtop/src/parse.rs index ce374f1..aaacad3 100644 --- a/src/uu/slabtop/src/parse.rs +++ b/src/uu/slabtop/src/parse.rs @@ -11,7 +11,7 @@ use std::{ }; #[derive(Debug, Default)] -pub struct SlabInfo { +pub(crate) struct SlabInfo { pub(crate) meta: Vec, pub(crate) data: Vec<(String, Vec)>, } @@ -25,7 +25,7 @@ impl SlabInfo { Self::parse(content).ok_or(ErrorKind::Unsupported.into()) } - pub(crate) fn parse(content: String) -> Option { + pub fn parse(content: String) -> Option { let mut lines: Vec<&str> = content.lines().collect(); let _ = parse_version(lines.remove(0))?; @@ -154,7 +154,7 @@ impl SlabInfo { .sum::() } - pub(crate) fn object_minimum(&self) -> u64 { + pub fn object_minimum(&self) -> u64 { let Some(offset) = self.offset("objsize") else { return 0; }; @@ -170,7 +170,7 @@ impl SlabInfo { } } - pub(crate) fn object_maximum(&self) -> u64 { + pub fn object_maximum(&self) -> u64 { let Some(offset) = self.offset("objsize") else { return 0; }; @@ -186,7 +186,7 @@ impl SlabInfo { } } - pub(crate) fn object_avg(&self) -> u64 { + pub fn object_avg(&self) -> u64 { let Some(offset) = self.offset("objsize") else { return 0; }; @@ -203,23 +203,23 @@ impl SlabInfo { } } - pub(crate) fn total_active_objs(&self) -> u64 { + pub fn total_active_objs(&self) -> u64 { self.total("active_objs") } - pub(crate) fn total_objs(&self) -> u64 { + pub fn total_objs(&self) -> u64 { self.total("num_objs") } - pub(crate) fn total_active_slabs(&self) -> u64 { + pub fn total_active_slabs(&self) -> u64 { self.total("active_slabs") } - pub(crate) fn total_slabs(&self) -> u64 { + pub fn total_slabs(&self) -> u64 { self.total("num_slabs") } - pub(crate) fn total_active_size(&self) -> u64 { + pub fn total_active_size(&self) -> u64 { self.names() .iter() .map(|name| { @@ -229,7 +229,7 @@ impl SlabInfo { .sum::() } - pub(crate) fn total_size(&self) -> u64 { + pub fn total_size(&self) -> u64 { self.names() .iter() .map(|name| { @@ -239,7 +239,7 @@ impl SlabInfo { .sum::() } - pub(crate) fn total_active_cache(&self) -> u64 { + pub fn total_active_cache(&self) -> u64 { self.names() .iter() .map(|name| { @@ -249,7 +249,7 @@ impl SlabInfo { .sum::() } - pub(crate) fn total_cache(&self) -> u64 { + pub fn total_cache(&self) -> u64 { self.names() .iter() .map(|name| {