QuarkDoe

for_reddit

Oct 25th, 2016
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. Hello.
  2.  
  3. If i compile this code,
  4.  
  5. extern crate noise;
  6. extern crate rand;
  7.  
  8. use noise::*;
  9.  
  10. fn test(){
  11. let mut v = vec![ Brownian2::new( perlin2::<f64>, 4) ];
  12. println!( "{:?}", v );
  13. }
  14.  
  15. rustc says that v have elemetns with type
  16.  
  17. noise::Brownian2<f64, fn(&noise::PermutationTable, &[f64; 2]) -> f64 {noise::perlin2::<f64>}>
  18.  
  19. Question.
  20. How should i define my type, so following code will compile correctly:
  21. extern crate noise;
  22. extern crate rand;
  23.  
  24. use noise::*;
  25.  
  26. type Generator = <... there is something to be ...>;
  27.  
  28. fn test() {
  29. let mut a: Vec<Generator> = Vec::new();
  30. a.push( Brownian2::new( &perlin2::<f64>, 4) );
  31. }
Add Comment
Please, Sign In to add comment