Skip to content

Commit

Permalink
Add #[derive(Clone, Copy... on all bitflags
Browse files Browse the repository at this point in the history
This will make it easier to use them, e.g. I won't need to re-create `FunctionFlags` for registering multiple similar functions.
  • Loading branch information
nyurik committed Oct 6, 2023
1 parent 6176b11 commit 097ce05
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/functions.rs
Expand Up @@ -311,6 +311,7 @@ bitflags::bitflags! {
/// Function Flags.
/// See [sqlite3_create_function](https://sqlite.org/c3ref/create_function.html)
/// and [Function Flags](https://sqlite.org/c3ref/c_deterministic.html) for details.
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
#[repr(C)]
pub struct FunctionFlags: ::std::os::raw::c_int {
/// Specifies UTF-8 as the text encoding this SQL function prefers for its parameters.
Expand Down
1 change: 1 addition & 0 deletions src/vtab/mod.rs
Expand Up @@ -372,6 +372,7 @@ impl From<u8> for IndexConstraintOp {
bitflags::bitflags! {
/// Virtual table scan flags
/// See [Function Flags](https://sqlite.org/c3ref/c_index_scan_unique.html) for details.
#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
#[repr(C)]
pub struct IndexFlags: ::std::os::raw::c_int {
/// Default
Expand Down
2 changes: 1 addition & 1 deletion src/vtab/series.rs
Expand Up @@ -28,7 +28,7 @@ const SERIES_COLUMN_STOP: c_int = 2;
const SERIES_COLUMN_STEP: c_int = 3;

bitflags::bitflags! {
#[derive(Clone, Copy)]
#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
#[repr(C)]
struct QueryPlanFlags: ::std::os::raw::c_int {
// start = $value -- constraint exists
Expand Down

0 comments on commit 097ce05

Please sign in to comment.