vlcn-io / cr-sqlite

Convergent, Replicated SQLite. Multi-writer and CRDT support for SQLite
https://vlcn.io
MIT License
2.61k stars 69 forks source link

[core/rs/{bundle/src/lib.rs,fractindex-core/src/lib.rs}] Resolve two `unused import` warnings #425

Closed SamuelMarks closed 4 weeks ago

SamuelMarks commented 4 months ago

Other warnings I found are:

warning: unused variable: `argc`
   --> cr-sqlite/core/rs/core/src/lib.rs:776:5
    |
776 |     argc: i32,
    |     ^^^^ help: if this is intentional, prefix it with an underscore: `_argc`
    |
    = note: `#[warn(unused_variables)]` on by default

warning: unused variable: `argv`
   --> cr-sqlite/core/rs/core/src/lib.rs:777:5
    |
777 |     argv: *mut *mut sqlite::value,
    |     ^^^^ help: if this is intentional, prefix it with an underscore: `_argv`

warning: unused variable: `argc`
   --> cr-sqlite/core/rs/core/src/lib.rs:784:5
    |
784 |     argc: i32,
    |     ^^^^ help: if this is intentional, prefix it with an underscore: `_argc`

warning: unused variable: `argv`
   --> cr-sqlite/core/rs/core/src/lib.rs:785:5
    |
785 |     argv: *mut *mut sqlite::value,
    |     ^^^^ help: if this is intentional, prefix it with an underscore: `_argv`

warning: function `x_crsql_version` is never used
   --> cr-sqlite/core/rs/core/src/lib.rs:782:22
    |
782 | unsafe extern "C" fn x_crsql_version(
    |                      ^^^^^^^^^^^^^^^
    |
    = note: `#[warn(dead_code)]` on by default

warning: constant `CRSQLITE_VERSION_STR` is never used
  --> cr-sqlite/core/rs/core/src/consts.rs:15:11
   |
15 | pub const CRSQLITE_VERSION_STR: &'static str = "0.16.3";
   |           ^^^^^^^^^^^^^^^^^^^^

warning: `crsql_fractindex_core` (lib) generated 1 warning (run `cargo fix --lib -p crsql_fractindex_core` to apply 1 suggestion)
   Compiling crsql_bundle v0.1.0 (cr-sqlite/core/rs/bundle)
warning: the feature `lang_items` is internal to the compiler or standard library
 --> cr-sqlite/core/rs/bundle/src/lib.rs:3:12
  |
3 | #![feature(lang_items)]
  |            ^^^^^^^^^^
  |
  = note: using it is strongly discouraged
  = note: `#[warn(internal_features)]` on by default

It might be worthwhile to add the SQLite version to the .data section so we can easily find what version of SQLite the shared library was built against (without linking it first). I suppose putting it in the header would be worthwhile also; preferably as a #define.

tantaman commented 4 weeks ago

Thanks.