I want t stable rust coroutine iterator out of this [code] Not possible?
- User
I want t stable rust coroutine iterator out of this
rustfn set_of_factors(n: u64) -> Vec<u64> { if n < 2 { return vec![]; } let mut v: Vec<u64> = vec![]; let mut nr = n; if nr % 2 == 0 { nr /= 2; v.push(2); while nr % 2 == 0 { nr /= 2; } if nr == 1 { return v; } } if nr % 3 == 0 { nr /= 3; v.push(3); while nr % 3 == 0 { nr /= 3; } if nr == 1 { return v; } } let mut d = 5; loop { if nr % d == 0 { nr /= d; v.push(d); while nr % d == 0 { nr /= d; } if nr == 1 { return v; } } d += 2; if nr % d == 0 { nr /= d; v.push(d); while nr % d == 0 { nr /= d; } if nr == 1 { return v; } } d += 4; } }Not possible?
- Assistant
- User
error: src/main.rs:64: failed to resolve: could not find
mainintokioerror: src/main.rs:64: could not findmainintokiowarning: src/main.rs:1: unused import:selfnote: src/main.rs:1:#[warn(unused_imports)]on by default help: src/main.rs:1: remove the unused import error: src/main.rs:65:mainfunction is not allowed to beasyncerror: src/main.rs:65:mainfunction is not allowed to beasync - Assistant