heinrich5991 / libtw2

Some Teeworlds stuff in Rust.™
Apache License 2.0
50 stars 16 forks source link

common: Make `file_offset` dependency optional #88

Closed Patiga closed 9 months ago

Patiga commented 9 months ago

Uses file_offset::FileExt::read_offset, which is only available for unix, windows. This change allows building for WebAssembly, by removing the implementation conditionally. Moved some uses for no warnings in the wasm build.

heinrich5991 commented 9 months ago

Could you move it behind a feature flag instead?

Patiga commented 9 months ago

Sure, also reworded the commit message to match the change. The feature is also turned on by default, for convenience and backwards compatibility.

heinrich5991 commented 9 months ago

Could you also make it non-default? I don't like default features, and backcompat isn't really required here, I think.

Patiga commented 9 months ago

The datafile module relied on the trait implementation for File. I activated the feature there. Or would that've been a reason for backwards compatibility?

heinrich5991 commented 9 months ago

The datafile module relied on the trait implementation for File. I activated the feature there.

Thanks.

Or would that've been a reason for backwards compatibility?

No.