refactor: from string impl
Remove redudant impl's, use `.as_str()`
This commit is contained in:
@@ -18,18 +18,6 @@ const ONE_GB: f64 = ONE_MB * 1000.0;
|
||||
#[derive(Debug, Clone, Eq, Hash, PartialEq)]
|
||||
pub struct ContainerId(String);
|
||||
|
||||
impl From<String> for ContainerId {
|
||||
fn from(x: String) -> Self {
|
||||
Self(x)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&String> for ContainerId {
|
||||
fn from(x: &String) -> Self {
|
||||
Self(x.clone())
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&str> for ContainerId {
|
||||
fn from(x: &str) -> Self {
|
||||
Self(x.to_owned())
|
||||
@@ -156,20 +144,6 @@ impl State {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<String> for State {
|
||||
fn from(input: String) -> Self {
|
||||
match input.as_ref() {
|
||||
"dead" => Self::Dead,
|
||||
"exited" => Self::Exited,
|
||||
"paused" => Self::Paused,
|
||||
"removing" => Self::Removing,
|
||||
"restarting" => Self::Restarting,
|
||||
"running" => Self::Running,
|
||||
_ => Self::Unknown,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&str> for State {
|
||||
fn from(input: &str) -> Self {
|
||||
match input {
|
||||
|
||||
Reference in New Issue
Block a user