These are chat archives for rust-lang/rust

11th
Jan 2018
TatriX
@TatriX
Jan 11 2018 20:43
Where should I look at to fix the following:
http://paste.org.ru/?c56ofi
Aleksey Kladov
@matklad
Jan 11 2018 20:45
@TatriX you probably have several versions of https://github.com/Frommi/miniz_oxide in your Cargo.lock
TatriX
@TatriX
Jan 11 2018 20:46
I just remove Cargo.lock but still error remains.
My dependencies are
[dependencies]
ggez = "0.4.0"
ncollide = "0.13.0"
tiled = "0.7.3"
Aleksey Kladov
@matklad
Jan 11 2018 20:47
Could you gist the lockfile?
TatriX
@TatriX
Jan 11 2018 20:47
If I remove tiled and related code everything works fine.
Sure
Looks like my dependencies use very different versions of the flate2
Aleksey Kladov
@matklad
Jan 11 2018 20:49

Ok, so these two things cause the problem:

miniz-sys 0.1.10
miniz_oxide_c_api

The first one is the biniding to miniz
the second one is the Rust rewrite of miniz, which exposes the same C API
flate2 has features to control which backend is in use
You may be able to tweak them
TatriX
@TatriX
Jan 11 2018 21:16
Ok, I fixed the rs-tiled and send a PR to the upstream. Thanks for the help ;)
TatriX
@TatriX
Jan 11 2018 21:23
To the next question.
There are a lof of places in rust where I can choose different options.
For example: &data[..] vs data.as_slice(). If there is any "best practice" on that topic?
oyvindln
@oyvindln
Jan 11 2018 22:23
@tatrix do you have an example of the code that gave you linking errors?
oyvindln
@oyvindln
Jan 11 2018 23:23
I submitted a PR to use the miniz_oxide_c_api feature that disables the no_mangle on the functions but I was unable to check if it worked as I didn't manage to reproduce the linking issue