From 42eb32765bdef575eba3719abbd966958bd17671 Mon Sep 17 00:00:00 2001 From: Tim Zhang Date: Thu, 29 Oct 2020 19:32:55 +0800 Subject: [PATCH] Make methods to_controller and controller_name of Subsystem public We need these functions to detect whether subsystem path exists. Signed-off-by: Tim Zhang --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index c910371..0761631 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -619,7 +619,7 @@ impl Subsystem { } } - fn to_controller(&self) -> &dyn Controller { + pub fn to_controller(&self) -> &dyn Controller { match self { Subsystem::Pid(cont) => cont, Subsystem::Mem(cont) => cont, @@ -638,7 +638,7 @@ impl Subsystem { } } - fn controller_name(&self) -> String { + pub fn controller_name(&self) -> String { self.to_controller().control_type().to_string() } }