Callbacks::draw() must not mutate the state

This commit is contained in:
Astro 2020-03-04 18:34:02 +01:00
부모 0effe28bfa
커밋 6eb7c31406
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제

파일 보기

@ -9,7 +9,7 @@ impl Callbacks for Example {
}
fn handle_event(&mut self, ev: Event) {}
fn update(&mut self) {}
fn draw(&mut self, graphics: &mut Graphics) {}
fn draw(&self, graphics: &mut Graphics) {}
fn clean_up(self) {}
}

파일 보기

@ -21,7 +21,7 @@ pub trait Callbacks {
}
fn handle_event(&mut self, ev: Event);
fn update(&mut self);
fn draw(&mut self, graphics: &mut Graphics);
fn draw(&self, graphics: &mut Graphics);
fn clean_up(self);
}