Skip to content

Commit 7f177cb

Browse files
committed
refactor(ipc): use constant for prod socket path
1 parent cb9de6e commit 7f177cb

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/common/ipc.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,13 @@ impl Profile {
2222
}
2323

2424
pub fn get_socket_path() -> &'static str {
25-
let brew_var =
26-
std::env::var("HOMEBREW_VAR").unwrap_or_else(|_| "/opt/homebrew/var".to_string());
27-
28-
let prod_socket_path = format!("{}/run/turtle-harbor.sock", brew_var);
25+
const PROD_SOCKET_PATH: &str = "/opt/homebrew/var/run/turtle-harbor.sock";
2926
const DEV_SOCKET_PATH: &str = "/tmp/turtle-harbor.sock";
3027

3128
let current_profile = Profile::current();
3229
let path = match current_profile {
3330
Profile::Development => DEV_SOCKET_PATH,
34-
Profile::Production => prod_socket_path.as_str(),
31+
Profile::Production => PROD_SOCKET_PATH,
3532
};
3633
tracing::debug!(socket_path = path, "Using socket path");
3734
path

0 commit comments

Comments
 (0)