Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pub struct RelativePath {
- pub segments: Vec<String>
- }
- pub struct AbsolutePath {
- pub segments: Vec<PathSegment>
- }
- #[derive(Clone, Debug, PartialEq)]
- enum PathSegment {
- Placeholder(String),
- Literal(String)
- }
- impl AbsolutePath {
- pub fn append(&mut self, mut path: RelativePath) {
- // &mut path.segments
- let &mut lits = path.segments.iter_mut().map(|s| PathSegment::Literal(s.to_string())).collect();
- self.segments.append(lits);
- }
- }
- fn main() {}
Add Comment
Please, Sign In to add comment