Use correct types so builder_data example works.

This commit is contained in:
Nolan Darilek 2022-03-14 11:39:23 -05:00
parent 66a470d669
commit a49e9d019b
1 changed files with 8 additions and 4 deletions

View File

@ -12,9 +12,13 @@ struct MyData {
struct IncrementData;
impl<D: Clone + Default> MapFilter<D> for IncrementData {
fn modify_map(&self, rng: &mut rand::prelude::StdRng, map: &mapgen::Map<D>) -> mapgen::Map<D> {
let map = map.clone();
impl MapFilter<MyData> for IncrementData {
fn modify_map(
&self,
_rng: &mut rand::prelude::StdRng,
map: &mapgen::Map<MyData>,
) -> mapgen::Map<MyData> {
let mut map = map.clone();
map.data.value += 1;
map
}
@ -29,5 +33,5 @@ fn main() {
.with(Box::new(IncrementData))
.build();
println!("{:}", &map);
println!("{:}\n{}", map, map.data.value);
}