use std::fs::File;
use std::io::{ErrorKind, Read};
use std::*;
use std::ops::{Add, Mul};
use std::env;
use std::ffi::OsString;
use std::error::Error;
use rust_sample_rtx::Config;
use std::thread;
use std::time::Duration;
use git2::Repository;
fn main(){
let mut counter = Counter::next(&mut Counter { count: 4 });
println!("{:?}", counter);
}
#[derive(Debug)]
struct Counter{
count: u32
}
impl Counter{
fn new() -> Counter{
Counter{ count: 0 }
}
}
impl Iterator for Counter{
type Item = u32;
fn next(&mut self) -> Option<Self::Item>{
if self.count < 5{
self.count += 1;
Some(self.count)
}
else { None }
}
}