/******************************************************************************
Online Rust Compiler.
Code, Compile, Run and Debug Rust program online.
Write your code in this editor and press "Run" button to execute it.
*******************************************************************************/
use std::ops::Add;
struct Shell {
v: Vec<i32>,
}
impl Add<Shell> for Shell {
type Output = Vec<i32>;
fn add(mut self, mut other: Self) -> Vec<i32> {
let mut together: Vec<i32> = Vec::<i32>::new();
together.append(&mut self.v);
together.append(&mut other.v);
together
}
}
fn main() {
let mut one = vec![1,2,3,4,5];
let mut two = vec![10, 20, 30, 40, 50];
let mut shell_one = Shell{v: one};
let mut shell_two = Shell{v: two};
let three = shell_one + shell_two;
for i in &three {
print!("{} ", i);
}
}