WaDelma / poisson

n-dimensional poisson-disk distribution generation for rust.
MIT License
10 stars 8 forks source link

wasm support #21

Closed JoeHowarth closed 6 years ago

JoeHowarth commented 6 years ago

Hi!

I'm trying to port a js map generation system to rust and found your awesome blue noise library. Unfortunately, when compiling to wasm I get the error

  Compiling rustc-serialize v0.3.24
error[E0046]: not all trait items implemented, missing: 'encode'
    --> /Users/jh/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-serialize-0.3.24/src/serialize.rs:1358:1
     |
853  |     fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error>;
     |     ---------------------------------------------------------------- 'encode' from trait
...
1358 | impl Encodable for path::Path {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing 'encode' in implementation

error[E0046]: not all trait items implemented, missing: 'decode'
    --> /Users/jh/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-serialize-0.3.24/src/serialize.rs:1382:1
     |
904  |     fn decode<D: Decoder>(d: &mut D) -> Result<Self, D::Error>;
     |     ----------------------------------------------------------- 'decode' from trait
...
1382 | impl Decodable for path::PathBuf {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing 'decode' in implementation

It seems to be a problem with depending on serialization, would it be possible to put whatever features use serialization behind a feature gate?

WaDelma commented 6 years ago

This is not directly caused by having any serialization features: The sphere dependency was older version which depended to num instead of num-traits which brought lots of unnecessary stuff.

JoeHowarth commented 6 years ago

Thanks! That fixed it for me