mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-03-23 10:38:57 +00:00
Update bitflags to v2 (#2564)
This commit is contained in:
@@ -48,7 +48,7 @@ uuid = { workspace = true, optional = true }
|
||||
# Misc
|
||||
atoi = "2.0"
|
||||
base64 = { version = "0.21.0", default-features = false, features = ["std"] }
|
||||
bitflags = { version = "1.3.2", default-features = false }
|
||||
bitflags = { version = "2", default-features = false }
|
||||
byteorder = { version = "1.4.3", default-features = false, features = ["std"] }
|
||||
dotenvy = { workspace = true }
|
||||
hex = "0.4.3"
|
||||
|
||||
@@ -166,6 +166,7 @@ impl<'r> Decode<'r, Postgres> for PgLQuery {
|
||||
|
||||
bitflags! {
|
||||
/// Modifiers that can be set to non-star labels
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
pub struct PgLQueryVariantFlag: u16 {
|
||||
/// * - Match any label with this prefix, for example foo* matches foobar
|
||||
const ANY_END = 0x01;
|
||||
@@ -263,7 +264,7 @@ impl FromStr for PgLQueryVariant {
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
let mut label_length = s.len();
|
||||
let mut rev_iter = s.bytes().rev();
|
||||
let mut modifiers = PgLQueryVariantFlag { bits: 0 };
|
||||
let mut modifiers = PgLQueryVariantFlag::empty();
|
||||
|
||||
while let Some(b) = rev_iter.next() {
|
||||
match b {
|
||||
|
||||
@@ -13,16 +13,17 @@ use crate::{PgArgumentBuffer, PgHasArrayType, PgTypeInfo, PgValueFormat, PgValue
|
||||
|
||||
// https://github.com/postgres/postgres/blob/2f48ede080f42b97b594fb14102c82ca1001b80c/src/include/utils/rangetypes.h#L35-L44
|
||||
bitflags! {
|
||||
struct RangeFlags: u8 {
|
||||
const EMPTY = 0x01;
|
||||
const LB_INC = 0x02;
|
||||
const UB_INC = 0x04;
|
||||
const LB_INF = 0x08;
|
||||
const UB_INF = 0x10;
|
||||
const LB_NULL = 0x20; // not used
|
||||
const UB_NULL = 0x40; // not used
|
||||
const CONTAIN_EMPTY = 0x80; // internal
|
||||
}
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
struct RangeFlags: u8 {
|
||||
const EMPTY = 0x01;
|
||||
const LB_INC = 0x02;
|
||||
const UB_INC = 0x04;
|
||||
const LB_INF = 0x08;
|
||||
const UB_INF = 0x10;
|
||||
const LB_NULL = 0x20; // not used
|
||||
const UB_NULL = 0x40; // not used
|
||||
const CONTAIN_EMPTY = 0x80; // internal
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Eq, Clone)]
|
||||
|
||||
Reference in New Issue
Block a user