Skip to content

Commit 66858a6

Browse files
committed
rust: remove dead code
Signed-off-by: Piyush Jena <[email protected]>
1 parent fc8d441 commit 66858a6

File tree

3 files changed

+1
-29
lines changed

3 files changed

+1
-29
lines changed

sources/netdog/src/cli/mod.rs

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use crate::{
1414
pub(crate) use generate_hostname::GenerateHostnameArgs;
1515
pub(crate) use generate_net_config::GenerateNetConfigArgs;
1616
pub(crate) use node_ip::NodeIpArgs;
17-
use serde::{Deserialize, Serialize};
17+
use serde::Serialize;
1818
pub(crate) use set_hostname::SetHostnameArgs;
1919
use snafu::{ensure, OptionExt, ResultExt};
2020
use std::fmt::Write;
@@ -25,24 +25,6 @@ use std::{fs, io};
2525
pub(crate) use write_network_status::WriteNetworkStatusArgs;
2626
pub(crate) use write_resolv_conf::WriteResolvConfArgs;
2727

28-
#[derive(Debug, PartialEq, Deserialize)]
29-
#[serde(rename_all = "kebab-case")]
30-
enum InterfaceType {
31-
Dhcp,
32-
Static,
33-
}
34-
35-
#[derive(Debug, PartialEq, Deserialize)]
36-
#[serde(rename_all = "kebab-case")]
37-
enum InterfaceFamily {
38-
Ipv4,
39-
Ipv6,
40-
}
41-
42-
// Implement `from_str()` so argh can attempt to deserialize args into their proper types
43-
derive_fromstr_from_deserialize!(InterfaceType);
44-
derive_fromstr_from_deserialize!(InterfaceFamily);
45-
4628
/// Helper function that serializes the input to JSON and prints it
4729
fn print_json<S>(val: S) -> Result<()>
4830
where

sources/netdog/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ supplementing any missing settings with DNS settings from the primary interface'
2626
is meant to be used as a restart command for DNS API settings.
2727
*/
2828

29-
#[macro_use]
3029
extern crate serde_plain;
3130

3231
mod addressing;

sources/netdog/src/net_config/devices/mod.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,6 @@ impl Validate for NetworkDeviceV1 {
4242
}
4343
}
4444

45-
#[derive(Debug, Deserialize)]
46-
#[serde(untagged)]
47-
pub(crate) enum DeviceType {
48-
#[serde(rename = "bond")]
49-
Bond,
50-
#[serde(rename = "vlan")]
51-
Vlan,
52-
}
53-
5445
pub(crate) trait HasIpAddressing {
5546
fn has_static(&self) -> bool;
5647

0 commit comments

Comments
 (0)