From 5acf030057c7045ca89700a18585421ee0f81c4a Mon Sep 17 00:00:00 2001 From: kozistr Date: Sun, 9 Jun 2024 12:59:17 +0900 Subject: [PATCH] refactor: to_string to to_owned --- backends/python/src/management.rs | 18 +++++++++--------- router/tests/common.rs | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/backends/python/src/management.rs b/backends/python/src/management.rs index a95c405c..911c6984 100644 --- a/backends/python/src/management.rs +++ b/backends/python/src/management.rs @@ -34,22 +34,22 @@ impl BackendProcess { // Process args let mut python_server_args = vec![ model_path, - "--dtype".to_string(), + "--dtype".to_owned(), dtype, - "--uds-path".to_string(), - uds_path.to_string(), - "--logger-level".to_string(), - "INFO".to_string(), - "--json-output".to_string(), + "--uds-path".to_owned(), + uds_path.to_owned(), + "--logger-level".to_owned(), + "INFO".to_owned(), + "--json-output".to_owned(), ]; // OpenTelemetry if let Some(otlp_endpoint) = otlp_endpoint { - python_server_args.push("--otlp-endpoint".to_string()); + python_server_args.push("--otlp-endpoint".to_owned()); python_server_args.push(otlp_endpoint); } - python_server_args.push("--otlp-service-name".to_string()); + python_server_args.push("--otlp-service-name".to_owned()); python_server_args.push(otlp_service_name); // Copy current process env @@ -68,7 +68,7 @@ impl BackendProcess { Err(err) => { if err.kind() == io::ErrorKind::NotFound { return Err(BackendError::Start( - "python-text-embeddings-server not found in PATH".to_string(), + "python-text-embeddings-server not found in PATH".to_owned(), )); } return Err(BackendError::Start(err.to_string())); diff --git a/router/tests/common.rs b/router/tests/common.rs index a7d303ce..c8669c12 100644 --- a/router/tests/common.rs +++ b/router/tests/common.rs @@ -64,7 +64,7 @@ pub async fn start_server(model_id: String, revision: Option, dtype: DTy 2_000_000, None, None, - "text-embeddings-inference.server".to_string(), + "text-embeddings-inference.server".to_owned(), None, ) });