Browse Source

Fixed some diagnostics

master
e-dt 4 years ago
parent
commit
3b06c3e94b
  1. 2
      src/apr.rs
  2. 7
      src/behaviour.rs
  3. 1
      src/main.rs

2
src/apr.rs

@ -54,7 +54,7 @@ impl Apr {
// Load/create resources such as images here.
let mut board = board::make_board(xlen, ylen);
let mut actors: Vec<actor::Actor> = Vec::new();
let mut behaviours: Vec<behaviour::Behaviour> = vec![behaviour::Behaviour {
let behaviours: Vec<behaviour::Behaviour> = vec![behaviour::Behaviour {
moves: vec![
behaviour::MovePattern {
movement: (1, 0),

7
src/behaviour.rs

@ -23,9 +23,8 @@ pub struct MovePatIt<'a> {
impl Iterator for MovePatIt<'_> {
type Item = MovePattern;
fn next(&mut self) -> Option<Self::Item> {
match self.cache.pop() {
Some(x) => return Some(x),
None => (),
if let Some(x) = self.cache.pop() {
return Some(x);
}
let k = self.iter.next()?;
@ -59,7 +58,7 @@ impl Iterator for MovePatIt<'_> {
});
}
return Some(*k);
Some(*k)
}
} //if naive sucks

1
src/main.rs

@ -32,3 +32,4 @@ fn main() -> GameResult<()> {
// Run!
event::run(ctx, event_loop, apr);
}

Loading…
Cancel
Save