Razaekel / noise-rs

Procedural noise generation library for Rust.
Apache License 2.0
842 stars 118 forks source link

Example on main README throws error #356

Open mattmacf98 opened 1 month ago

mattmacf98 commented 1 month ago
use noise::{Fbm, Perlin};
use noise::utils::{NoiseMapBuilder, PlaneMapBuilder};

fn main() {
  let fbm = Fbm::<Perlin>::new(0);

  PlaneMapBuilder::<_, 2>::new(&fbm)
          .set_size(1000, 1000)
          .set_x_bounds(-5.0, 5.0)
          .set_y_bounds(-5.0, 5.0)
          .build()
          .write_to_file("fbm.png");
}

This code which lives in the main README as an example throws the error

error[E0599]: no method named `set_size` found for struct `PlaneMapBuilder<&Fbm<Perlin>, 2>` in the current scope
 --> src/main.rs:8:12
  |
7 | /       PlaneMapBuilder::<_, 2>::new(&fbm)
8 | |           .set_size(1000, 1000)
  | |           -^^^^^^^^ method not found in `PlaneMapBuilder<&Fbm<Perlin>, 2>`
  | |___________|
  | 
  |
  = note: the method was found for
          - `PlaneMapBuilder<NoiseFnWrapper<SourceFn, DIM>, DIM>`