Skip to content

Commit

Permalink
impl Display. // appease clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
meowjesty committed Feb 15, 2024
1 parent 0996c04 commit fee7993
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions mirrord/cli/src/operator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ async fn operator_session(
operation_progress.print("killing all sessions");

session_api
.delete(&format!("kill_all"), &DeleteParams::default())
.delete("kill_all", &DeleteParams::default())
.await
.map_err(|error| OperatorApiError::KubeError {
error,
Expand All @@ -314,7 +314,7 @@ async fn operator_session(
operation_progress.print("retaining only active sessions");

session_api
.delete(&format!("retain_active"), &DeleteParams::default())
.delete("retain_active", &DeleteParams::default())
.await
.map_err(|error| OperatorApiError::KubeError {
error,
Expand Down
13 changes: 8 additions & 5 deletions mirrord/config/src/target.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
use std::{fmt, str::FromStr};
use std::{
fmt::{self, Display},
str::FromStr,
};

use mirrord_analytics::CollectAnalytics;
use schemars::JsonSchema;
Expand Down Expand Up @@ -290,16 +293,16 @@ pub struct PodTarget {
pub container: Option<String>,
}

impl ToString for PodTarget {
fn to_string(&self) -> String {
format!(
impl Display for PodTarget {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_fmt(format_args!(
"{}{}",
self.container
.clone()
.map(|c| format!("{c}/"))
.unwrap_or_default(),
self.pod.clone()
)
))
}
}

Expand Down

0 comments on commit fee7993

Please sign in to comment.