@opencode-cloud/core 1.0.8 → 3.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -53,15 +53,15 @@ impl SystemdManager {
53
53
 
54
54
  // Quote path if it contains spaces
55
55
  let exec_start = if executable_path.contains(' ') {
56
- format!("\"{}\" start --no-daemon", executable_path)
56
+ format!("\"{executable_path}\" start --no-daemon")
57
57
  } else {
58
- format!("{} start --no-daemon", executable_path)
58
+ format!("{executable_path} start --no-daemon")
59
59
  };
60
60
 
61
61
  let exec_stop = if executable_path.contains(' ') {
62
- format!("\"{}\" stop", executable_path)
62
+ format!("\"{executable_path}\" stop")
63
63
  } else {
64
- format!("{} stop", executable_path)
64
+ format!("{executable_path} stop")
65
65
  };
66
66
 
67
67
  // Calculate StartLimitIntervalSec: restart_delay * restart_retries * 2
@@ -103,7 +103,7 @@ WantedBy=default.target
103
103
  }
104
104
  cmd.args(args)
105
105
  .output()
106
- .map_err(|e| anyhow!("Failed to run systemctl: {}", e))
106
+ .map_err(|e| anyhow!("Failed to run systemctl: {e}"))
107
107
  }
108
108
 
109
109
  /// Run systemctl and check for success
@@ -214,7 +214,7 @@ impl ServiceManager for SystemdManager {
214
214
  }
215
215
 
216
216
  fn service_file_path(&self) -> PathBuf {
217
- self.service_dir().join(format!("{}.service", SERVICE_NAME))
217
+ self.service_dir().join(format!("{SERVICE_NAME}.service"))
218
218
  }
219
219
 
220
220
  fn service_name(&self) -> &str {
@@ -131,7 +131,7 @@ fn is_process_running(pid: u32) -> bool {
131
131
  // Fallback: check /proc on Linux
132
132
  #[cfg(target_os = "linux")]
133
133
  {
134
- std::path::Path::new(&format!("/proc/{}", pid)).exists()
134
+ std::path::Path::new(&format!("/proc/{pid}")).exists()
135
135
  }
136
136
  #[cfg(not(target_os = "linux"))]
137
137
  {
package/src/version.rs CHANGED
@@ -17,12 +17,7 @@ pub fn get_version_long() -> String {
17
17
  let git_hash = option_env!("OCC_GIT_HASH").unwrap_or("unknown");
18
18
  let build_date = option_env!("OCC_BUILD_DATE").unwrap_or("unknown");
19
19
 
20
- format!(
21
- "{version} (git: {git_hash}, built: {build_date})",
22
- version = version,
23
- git_hash = git_hash,
24
- build_date = build_date
25
- )
20
+ format!("{version} (git: {git_hash}, built: {build_date})")
26
21
  }
27
22
 
28
23
  #[cfg(test)]