Commit 42d8f444 authored by Nawasan Wisitsingkhon's avatar Nawasan Wisitsingkhon

remove impl Clone, and use derve(Clone) instead

parent 749e51b1
...@@ -25,6 +25,7 @@ pub enum ActionType { ...@@ -25,6 +25,7 @@ pub enum ActionType {
Enqueue = 11, Enqueue = 11,
} }
#[derive(Clone)]
pub enum Action { pub enum Action {
Oputput(PseudoPort), Oputput(PseudoPort),
SetDlVlan(Option<u16>), SetDlVlan(Option<u16>),
...@@ -239,23 +240,4 @@ impl SizeCheck for Vec<Action> { ...@@ -239,23 +240,4 @@ impl SizeCheck for Vec<Action> {
not_ctrl.append(&mut is_ctrl); not_ctrl.append(&mut is_ctrl);
not_ctrl not_ctrl
} }
} }
\ No newline at end of file
impl Clone for Action {
fn clone(&self) -> Self {
match self {
Self::Oputput(v) => Self::Oputput(v.clone()),
Self::SetDlVlan(v) => Self::SetDlVlan(v.clone()),
Self::SetDlVlanPcp(v) => Self::SetDlVlanPcp(v.clone()),
Self::SetDlSrc(v) => Self::SetDlSrc(v.clone()),
Self::SetDlDest(v) => Self::SetDlDest(v.clone()),
Self::SetIpSrc(v) => Self::SetIpSrc(v.clone()),
Self::SetIpDes(v) => Self::SetIpDes(v.clone()),
Self::SetTos(v) => Self::SetTos(v.clone()),
Self::SetTpSrc(v) => Self::SetTpSrc(v.clone()),
Self::SetTpDest(v) => Self::SetTpDest(v.clone()),
Self::Enqueue(v, arg1) => Self::Enqueue(v.clone(), arg1.clone()),
Self::Unparsable => Self::Unparsable,
}
}
}
...@@ -12,6 +12,7 @@ pub enum OfpPort { ...@@ -12,6 +12,7 @@ pub enum OfpPort {
None = 0xffff, None = 0xffff,
} }
#[derive(Clone)]
pub enum PseudoPort { pub enum PseudoPort {
PhysicalPort(u16), PhysicalPort(u16),
InPort, InPort,
...@@ -68,19 +69,3 @@ impl PseudoPort { ...@@ -68,19 +69,3 @@ impl PseudoPort {
let _ = bytes.write_u16::<BigEndian>(port); let _ = bytes.write_u16::<BigEndian>(port);
} }
} }
impl Clone for PseudoPort {
fn clone(&self) -> Self {
match self {
Self::PhysicalPort(arg0) => Self::PhysicalPort(arg0.clone()),
Self::InPort => Self::InPort,
Self::Table => Self::Table,
Self::Normal => Self::Normal,
Self::Flood => Self::Flood,
Self::AllPorts => Self::AllPorts,
Self::Controller(arg0) => Self::Controller(arg0.clone()),
Self::Local => Self::Local,
Self::Unsupport => Self::Unsupport,
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment