1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
use super::*; pub trait ContainerSpec { fn push<E>(&mut self, element: E) where E: Into<Element>; } impl ContainerSpec for InterfaceSpec { fn push<E>(&mut self, element: E) where E: Into<Element> { self.elements.push(element); } } impl ContainerSpec for ClassSpec { fn push<E>(&mut self, element: E) where E: Into<Element> { self.elements.push(element); } } impl ContainerSpec for EnumSpec { fn push<E>(&mut self, element: E) where E: Into<Element> { self.elements.push(element); } }