skade / leveldb-sys

MIT License
7 stars 15 forks source link

Fix opaque types #23

Closed skade closed 3 years ago

skade commented 3 years ago

This fixes a long-standing issue that was always a thorn in my side but did probably not impact anyone.

It replaces the pattern:

enum leveldb_t {}

With

#[repr(C)]
struct leveldb_t {
    _private: [u8; 0]
}

Which is the correct way to declare opaque types until RFC 1861 finally lands.

For that, it uses ffi-opaque.

Open question: is this semver-compatible?