ewilken / hap-rs

Rust implementation of the Apple HomeKit Accessory Protocol (HAP)
Apache License 2.0
197 stars 35 forks source link

Fix bug in FileStorage. #36

Closed Gaelan closed 3 years ago

Gaelan commented 3 years ago

FileStorage was opening files for writing without turning on truncate, so if the new contents were smaller, we'd leave some of the old file behind, making it invalid JSON.

This PR fixes that, and adds a test.

Closes #35.

ewilken commented 3 years ago

v0.1.0-pre.5 with the fix is out on crates.io.