refactor: simplify function return types and remove unnecessary wraps

This commit is contained in:
Tunglies
2025-11-15 08:56:58 +08:00
parent 2b0ba4dc95
commit a6cb903fe6
16 changed files with 37 additions and 55 deletions
+4 -1
View File
@@ -27,7 +27,10 @@ impl CoreManager {
match *self.get_running_mode() {
RunningMode::Service => self.stop_core_by_service().await,
RunningMode::Sidecar => self.stop_core_by_sidecar(),
RunningMode::Sidecar => {
self.stop_core_by_sidecar();
Ok(())
}
RunningMode::NotRunning => Ok(()),
}
}
+1 -2
View File
@@ -96,7 +96,7 @@ impl CoreManager {
Ok(())
}
pub(super) fn stop_core_by_sidecar(&self) -> Result<()> {
pub(super) fn stop_core_by_sidecar(&self) {
logging!(info, Type::Core, "Stopping sidecar");
defer! {
self.set_running_mode(RunningMode::NotRunning);
@@ -106,7 +106,6 @@ impl CoreManager {
drop(child);
logging!(trace, Type::Core, "Sidecar stopped (PID: {:?})", pid);
}
Ok(())
}
pub(super) async fn start_core_by_service(&self) -> Result<()> {