use std::ops::AddAssign;

struct Progress<T> {
    start: T,
    end: T,
    step: T,
    current: T,
}

//impl<T> Progress<T> {
//    fn forward(&mut self) {
//        self.current += self.step;
//    }
//}

//impl<T: AddAssign + Copy> Progress<T> {
//    fn forward(&mut self) {
//        self.current += self.step;
//    }
//}

impl<T> Progress<T> 
    where T: AddAssign + Copy {
    fn forward(&mut self) {
        self.current += self.step;
    }
}

fn main() {
    let mut progress = Progress {
        start: 0,
        end: 100,
        step: 10,
        current: 0,
    };

    while progress.current < progress.end {
        progress.forward();
        println!("Current progress: {}", progress.current);
    }
    for i in (progress.start..=progress.end).step_by(progress.step as usize) {
        println!("Progress: {}%", i);
    }
}