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 <tim@hyper.sh>
This commit is contained in:
Tim Zhang
2020-10-29 19:32:55 +08:00
parent efb98108fc
commit 42eb32765b

View File

@@ -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()
}
}