mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2025-12-22 22:20:02 +00:00
chore: update toolchain to 2024-12-25 (#5430)
* chore: update toolchain to 2024-12-25 * chore: fix clippy * feat: update flakes * chore: remove `rerun-if-changed` for now * chore: update shadow-rs * fix: clippy * chore: update version in DEV_BUILDER_IMAGE_TAG --------- Co-authored-by: Ning Sun <sunning@greptime.com>
This commit is contained in:
139
Cargo.lock
generated
139
Cargo.lock
generated
@@ -4583,6 +4583,19 @@ dependencies = [
|
||||
"byteorder",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "generator"
|
||||
version = "0.8.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cc6bd114ceda131d3b1d665eba35788690ad37f5916457286b32ab6fd3c438dd"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"libc",
|
||||
"log",
|
||||
"rustversion",
|
||||
"windows 0.58.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "generic-array"
|
||||
version = "0.14.7"
|
||||
@@ -4678,9 +4691,9 @@ checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64"
|
||||
|
||||
[[package]]
|
||||
name = "git2"
|
||||
version = "0.19.0"
|
||||
version = "0.20.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b903b73e45dc0c6c596f2d37eccece7c1c8bb6e4407b001096387c63d0d93724"
|
||||
checksum = "3fda788993cc341f69012feba8bf45c0ba4f3291fcc08e214b4d5a7332d88aff"
|
||||
dependencies = [
|
||||
"bitflags 2.6.0",
|
||||
"libc",
|
||||
@@ -5357,7 +5370,7 @@ dependencies = [
|
||||
"iana-time-zone-haiku",
|
||||
"js-sys",
|
||||
"wasm-bindgen",
|
||||
"windows-core",
|
||||
"windows-core 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5597,9 +5610,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "is_debug"
|
||||
version = "1.0.1"
|
||||
version = "1.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "06d198e9919d9822d5f7083ba8530e04de87841eaf21ead9af8f2304efd57c89"
|
||||
checksum = "e8ea828c9d6638a5bd3d8b14e37502b4d56cae910ccf8a5b7f51c7a0eb1d0508"
|
||||
|
||||
[[package]]
|
||||
name = "is_terminal_polyfill"
|
||||
@@ -6087,9 +6100,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "libgit2-sys"
|
||||
version = "0.17.0+1.8.1"
|
||||
version = "0.18.0+1.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "10472326a8a6477c3c20a64547b0059e4b0d086869eee31e6d7da728a8eb7224"
|
||||
checksum = "e1a117465e7e1597e8febea8bb0c410f1c7fb93b1e1cddf34363f8390367ffec"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"libc",
|
||||
@@ -6257,6 +6270,19 @@ dependencies = [
|
||||
"prost-types 0.13.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "loom"
|
||||
version = "0.7.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "419e0dc8046cb947daa77eb95ae174acfbddb7673b4151f56d1eed8e93fbfaca"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"generator",
|
||||
"scoped-tls",
|
||||
"tracing",
|
||||
"tracing-subscriber",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "lrlex"
|
||||
version = "0.13.7"
|
||||
@@ -6793,25 +6819,23 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "moka"
|
||||
version = "0.12.8"
|
||||
version = "0.12.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "32cf62eb4dd975d2dde76432fb1075c49e3ee2331cf36f1f8fd4b66550d32b6f"
|
||||
checksum = "a9321642ca94a4282428e6ea4af8cc2ca4eac48ac7a6a4ea8f33f76d0ce70926"
|
||||
dependencies = [
|
||||
"async-lock",
|
||||
"async-trait",
|
||||
"crossbeam-channel",
|
||||
"crossbeam-epoch",
|
||||
"crossbeam-utils",
|
||||
"event-listener 5.3.1",
|
||||
"futures-util",
|
||||
"once_cell",
|
||||
"loom",
|
||||
"parking_lot 0.12.3",
|
||||
"quanta",
|
||||
"portable-atomic",
|
||||
"rustc_version",
|
||||
"smallvec",
|
||||
"tagptr",
|
||||
"thiserror 1.0.64",
|
||||
"triomphe",
|
||||
"uuid",
|
||||
]
|
||||
|
||||
@@ -8903,21 +8927,6 @@ dependencies = [
|
||||
"variadics",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "quanta"
|
||||
version = "0.12.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8e5167a477619228a0b284fac2674e3c388cba90631d7b7de620e6f1fcd08da5"
|
||||
dependencies = [
|
||||
"crossbeam-utils",
|
||||
"libc",
|
||||
"once_cell",
|
||||
"raw-cpuid",
|
||||
"wasi",
|
||||
"web-sys",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "query"
|
||||
version = "0.12.0"
|
||||
@@ -9186,15 +9195,6 @@ dependencies = [
|
||||
"thiserror 1.0.64",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "raw-cpuid"
|
||||
version = "11.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1ab240315c661615f2ee9f0f2cd32d5a7343a84d5ebcccb99d46e6637565e7b0"
|
||||
dependencies = [
|
||||
"bitflags 2.6.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "raw-window-handle"
|
||||
version = "0.5.2"
|
||||
@@ -10086,6 +10086,12 @@ dependencies = [
|
||||
"syn 2.0.90",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "scoped-tls"
|
||||
version = "1.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294"
|
||||
|
||||
[[package]]
|
||||
name = "scopeguard"
|
||||
version = "1.2.0"
|
||||
@@ -10488,9 +10494,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "shadow-rs"
|
||||
version = "0.35.1"
|
||||
version = "0.38.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2311e39772c00391875f40e34d43efef247b23930143a70ca5fbec9505937420"
|
||||
checksum = "69d433b5df1e1958a668457ebe4a9c5b7bcfe844f4eb2276ac43cf273baddd54"
|
||||
dependencies = [
|
||||
"const_format",
|
||||
"git2",
|
||||
@@ -11421,7 +11427,7 @@ dependencies = [
|
||||
"ntapi",
|
||||
"once_cell",
|
||||
"rayon",
|
||||
"windows",
|
||||
"windows 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -12653,12 +12659,6 @@ version = "0.1.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "343e926fc669bc8cde4fa3129ab681c63671bae288b1f1081ceee6d9d37904fc"
|
||||
|
||||
[[package]]
|
||||
name = "triomphe"
|
||||
version = "0.1.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "859eb650cfee7434994602c3a68b25d77ad9e68c8a6cd491616ef86661382eb3"
|
||||
|
||||
[[package]]
|
||||
name = "try-lock"
|
||||
version = "0.2.5"
|
||||
@@ -13260,7 +13260,17 @@ version = "0.52.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be"
|
||||
dependencies = [
|
||||
"windows-core",
|
||||
"windows-core 0.52.0",
|
||||
"windows-targets 0.52.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows"
|
||||
version = "0.58.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6"
|
||||
dependencies = [
|
||||
"windows-core 0.58.0",
|
||||
"windows-targets 0.52.6",
|
||||
]
|
||||
|
||||
@@ -13273,6 +13283,41 @@ dependencies = [
|
||||
"windows-targets 0.52.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-core"
|
||||
version = "0.58.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99"
|
||||
dependencies = [
|
||||
"windows-implement",
|
||||
"windows-interface",
|
||||
"windows-result",
|
||||
"windows-strings",
|
||||
"windows-targets 0.52.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-implement"
|
||||
version = "0.58.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.90",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-interface"
|
||||
version = "0.58.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.90",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-registry"
|
||||
version = "0.2.0"
|
||||
|
||||
@@ -182,7 +182,7 @@ rustls = { version = "0.23.20", default-features = false } # override by patch,
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = { version = "1.0", features = ["float_roundtrip"] }
|
||||
serde_with = "3"
|
||||
shadow-rs = "0.35"
|
||||
shadow-rs = "0.38"
|
||||
similar-asserts = "1.6.0"
|
||||
smallvec = { version = "1", features = ["serde"] }
|
||||
snafu = "0.8"
|
||||
|
||||
2
Makefile
2
Makefile
@@ -8,7 +8,7 @@ CARGO_BUILD_OPTS := --locked
|
||||
IMAGE_REGISTRY ?= docker.io
|
||||
IMAGE_NAMESPACE ?= greptime
|
||||
IMAGE_TAG ?= latest
|
||||
DEV_BUILDER_IMAGE_TAG ?= 2024-10-19-9b9784a5-20250124053033
|
||||
DEV_BUILDER_IMAGE_TAG ?= 2024-12-25-9d0fa5d5-20250124085746
|
||||
BUILDX_MULTI_PLATFORM_BUILD ?= false
|
||||
BUILDX_BUILDER_NAME ?= gtbuilder
|
||||
BASE_IMAGE ?= ubuntu
|
||||
|
||||
18
flake.lock
generated
18
flake.lock
generated
@@ -8,11 +8,11 @@
|
||||
"rust-analyzer-src": "rust-analyzer-src"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1737527504,
|
||||
"narHash": "sha256-Z8S5gLPdIYeKwBXDaSxlJ72ZmiilYhu3418h3RSQZA0=",
|
||||
"lastModified": 1737613896,
|
||||
"narHash": "sha256-ldqXIglq74C7yKMFUzrS9xMT/EVs26vZpOD68Sh7OcU=",
|
||||
"owner": "nix-community",
|
||||
"repo": "fenix",
|
||||
"rev": "aa13f23e3e91b95377a693ac655bbc6545ebec0d",
|
||||
"rev": "303a062fdd8e89f233db05868468975d17855d80",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -41,11 +41,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1737404927,
|
||||
"narHash": "sha256-e1WgPJpIYbOuokjgylcsuoEUCB4Jl2rQXa2LUD6XAG8=",
|
||||
"lastModified": 1737569578,
|
||||
"narHash": "sha256-6qY0pk2QmUtBT9Mywdvif0i/CLVgpCjMUn6g9vB+f3M=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "ae584d90cbd0396a422289ee3efb1f1c9d141dc3",
|
||||
"rev": "47addd76727f42d351590c905d9d1905ca895b82",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -65,11 +65,11 @@
|
||||
"rust-analyzer-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1737453499,
|
||||
"narHash": "sha256-fa5AJI9mjFU2oVXqdCq2oA2pripAXbHzkUkewJRQpxA=",
|
||||
"lastModified": 1737581772,
|
||||
"narHash": "sha256-t1P2Pe3FAX9TlJsCZbmJ3wn+C4qr6aSMypAOu8WNsN0=",
|
||||
"owner": "rust-lang",
|
||||
"repo": "rust-analyzer",
|
||||
"rev": "0b68402d781955d526b80e5d479e9e47addb4075",
|
||||
"rev": "582af7ee9c8d84f5d534272fc7de9f292bd849be",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
mold
|
||||
(fenix.packages.${system}.fromToolchainFile {
|
||||
dir = ./.;
|
||||
sha256 = "sha256-9GnMWM2pjzawUuVU7EbnPMn79rMknaA4EaxipyTgqig=";
|
||||
sha256 = "sha256-f/CVA1EC61EWbh0SjaRNhLL0Ypx2ObupbzigZp8NmL4=";
|
||||
})
|
||||
cargo-nextest
|
||||
cargo-llvm-cov
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
[toolchain]
|
||||
channel = "nightly-2024-10-19"
|
||||
channel = "nightly-2024-12-25"
|
||||
components = ["rust-analyzer", "llvm-tools"]
|
||||
|
||||
@@ -100,7 +100,7 @@ pub fn options_from_column_schema(column_schema: &ColumnSchema) -> Option<Column
|
||||
pub fn contains_fulltext(options: &Option<ColumnOptions>) -> bool {
|
||||
options
|
||||
.as_ref()
|
||||
.map_or(false, |o| o.options.contains_key(FULLTEXT_GRPC_KEY))
|
||||
.is_some_and(|o| o.options.contains_key(FULLTEXT_GRPC_KEY))
|
||||
}
|
||||
|
||||
/// Tries to construct a `ColumnOptions` from the given `FulltextOptions`.
|
||||
|
||||
@@ -303,7 +303,7 @@ impl KvBackend for CachedKvBackend {
|
||||
.lock()
|
||||
.unwrap()
|
||||
.as_ref()
|
||||
.map_or(false, |v| !self.validate_version(*v))
|
||||
.is_some_and(|v| !self.validate_version(*v))
|
||||
{
|
||||
self.cache.invalidate(key).await;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ struct Test<'a, T: FileOpener> {
|
||||
expected: Vec<&'a str>,
|
||||
}
|
||||
|
||||
impl<'a, T: FileOpener> Test<'a, T> {
|
||||
impl<T: FileOpener> Test<'_, T> {
|
||||
pub async fn run(self) {
|
||||
let result = FileStream::new(
|
||||
&self.config,
|
||||
|
||||
@@ -164,7 +164,7 @@ impl FromStr for Decimal128 {
|
||||
type Err = Error;
|
||||
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
let len = s.as_bytes().len();
|
||||
let len = s.len();
|
||||
if len <= BYTES_TO_OVERFLOW_RUST_DECIMAL {
|
||||
let rd = RustDecimal::from_str_exact(s).context(ParseRustDecimalStrSnafu { raw: s })?;
|
||||
Ok(Self::from(rd))
|
||||
|
||||
@@ -78,7 +78,7 @@ impl DropTableProcedure {
|
||||
})
|
||||
}
|
||||
|
||||
pub(crate) async fn on_prepare<'a>(&mut self) -> Result<Status> {
|
||||
pub(crate) async fn on_prepare(&mut self) -> Result<Status> {
|
||||
if self.executor.on_prepare(&self.context).await?.stop() {
|
||||
return Ok(Status::done());
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ impl TxnOpGetResponseSet {
|
||||
impl From<&mut Vec<TxnOpResponse>> for TxnOpGetResponseSet {
|
||||
fn from(value: &mut Vec<TxnOpResponse>) -> Self {
|
||||
let value = value
|
||||
.extract_if(|resp| matches!(resp, TxnOpResponse::ResponseGet(_)))
|
||||
.extract_if(.., |resp| matches!(resp, TxnOpResponse::ResponseGet(_)))
|
||||
.flat_map(|resp| {
|
||||
// Safety: checked
|
||||
let TxnOpResponse::ResponseGet(r) = resp else {
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
|
||||
#![feature(assert_matches)]
|
||||
#![feature(btree_extract_if)]
|
||||
#![feature(async_closure)]
|
||||
#![feature(let_chains)]
|
||||
#![feature(extract_if)]
|
||||
#![feature(hash_extract_if)]
|
||||
|
||||
@@ -92,10 +92,7 @@ pub fn rename_logical_plan_columns(
|
||||
};
|
||||
|
||||
let (qualifier_rename, field_rename) =
|
||||
match plan.schema().qualified_field_from_column(&old_column) {
|
||||
Ok(qualifier_and_field) => qualifier_and_field,
|
||||
Err(err) => return Err(err),
|
||||
};
|
||||
plan.schema().qualified_field_from_column(&old_column)?;
|
||||
|
||||
for (qualifier, field) in plan.schema().iter() {
|
||||
if qualifier.eq(&qualifier_rename) && field.as_ref() == field_rename {
|
||||
|
||||
@@ -16,14 +16,9 @@ use std::collections::BTreeSet;
|
||||
use std::env;
|
||||
|
||||
use build_data::{format_timestamp, get_source_time};
|
||||
use shadow_rs::{CARGO_METADATA, CARGO_TREE};
|
||||
use shadow_rs::{BuildPattern, ShadowBuilder, CARGO_METADATA, CARGO_TREE};
|
||||
|
||||
fn main() -> shadow_rs::SdResult<()> {
|
||||
println!(
|
||||
"cargo:rerun-if-changed={}/.git/refs/heads",
|
||||
env!("CARGO_RUSTC_CURRENT_DIR")
|
||||
);
|
||||
|
||||
println!(
|
||||
"cargo:rustc-env=SOURCE_TIMESTAMP={}",
|
||||
if let Ok(t) = get_source_time() {
|
||||
@@ -39,10 +34,14 @@ fn main() -> shadow_rs::SdResult<()> {
|
||||
// made as a submodule in another repo.
|
||||
let src_path = env::var("CARGO_WORKSPACE_DIR").or_else(|_| env::var("CARGO_MANIFEST_DIR"))?;
|
||||
let out_path = env::var("OUT_DIR")?;
|
||||
let _ = shadow_rs::Shadow::build_with(
|
||||
src_path,
|
||||
out_path,
|
||||
BTreeSet::from([CARGO_METADATA, CARGO_TREE]),
|
||||
)?;
|
||||
|
||||
let _ = ShadowBuilder::builder()
|
||||
.build_pattern(BuildPattern::Lazy)
|
||||
.src_path(src_path)
|
||||
.out_path(out_path)
|
||||
.deny_const(BTreeSet::from([CARGO_METADATA, CARGO_TREE]))
|
||||
.build()
|
||||
.unwrap();
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ pub fn parse_string_to_vector_type_value(s: &str, dim: Option<u32>) -> Result<Ve
|
||||
let content = trimmed[1..trimmed.len() - 1].trim();
|
||||
|
||||
if content.is_empty() {
|
||||
if dim.map_or(false, |d| d != 0) {
|
||||
if dim.is_some_and(|d| d != 0) {
|
||||
return InvalidVectorSnafu {
|
||||
msg: format!("Failed to parse {s} to Vector value: wrong dimension"),
|
||||
}
|
||||
@@ -139,7 +139,7 @@ pub fn parse_string_to_vector_type_value(s: &str, dim: Option<u32>) -> Result<Ve
|
||||
.collect::<Result<Vec<f32>>>()?;
|
||||
|
||||
// Check dimension
|
||||
if dim.map_or(false, |d| d as usize != elements.len()) {
|
||||
if dim.is_some_and(|d| d as usize != elements.len()) {
|
||||
return InvalidVectorSnafu {
|
||||
msg: format!("Failed to parse {s} to Vector value: wrong dimension"),
|
||||
}
|
||||
|
||||
@@ -320,8 +320,7 @@ impl VectorDiff {
|
||||
|
||||
fn try_new(vector: VectorRef, diff: Option<VectorRef>) -> Result<Self, EvalError> {
|
||||
ensure!(
|
||||
diff.as_ref()
|
||||
.map_or(true, |diff| diff.len() == vector.len()),
|
||||
diff.as_ref().is_none_or(|diff| diff.len() == vector.len()),
|
||||
InvalidArgumentSnafu {
|
||||
reason: "Length of vector and diff should be the same"
|
||||
}
|
||||
|
||||
@@ -897,9 +897,6 @@ pub(crate) fn match_for_io_error(err_status: &tonic::Status) -> Option<&std::io:
|
||||
}
|
||||
}
|
||||
|
||||
err = match err.source() {
|
||||
Some(err) => err,
|
||||
None => return None,
|
||||
};
|
||||
err = err.source()?;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#![feature(async_closure)]
|
||||
#![feature(result_flattening)]
|
||||
#![feature(assert_matches)]
|
||||
#![feature(extract_if)]
|
||||
|
||||
@@ -67,7 +67,7 @@ impl UpdateMetadata {
|
||||
// Removes the candidate region in followers.
|
||||
let removed = region_route
|
||||
.follower_peers
|
||||
.extract_if(|peer| peer.id == candidate.id)
|
||||
.extract_if(.., |peer| peer.id == candidate.id)
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
if removed.len() > 1 {
|
||||
|
||||
@@ -358,7 +358,7 @@ impl RegionSupervisor {
|
||||
}
|
||||
|
||||
let migrating_regions = regions
|
||||
.extract_if(|(_, _, region_id)| {
|
||||
.extract_if(.., |(_, _, region_id)| {
|
||||
self.region_migration_manager.tracker().contains(*region_id)
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
@@ -80,7 +80,7 @@ impl heartbeat_server::Heartbeat for Metasrv {
|
||||
.await
|
||||
.map_err(|e| e.into());
|
||||
|
||||
is_not_leader = res.as_ref().map_or(false, |r| r.is_not_leader());
|
||||
is_not_leader = res.as_ref().is_ok_and(|r| r.is_not_leader());
|
||||
|
||||
debug!("Sending heartbeat response: {:?}", res);
|
||||
|
||||
|
||||
@@ -629,7 +629,7 @@ struct CompactionSstReaderBuilder<'a> {
|
||||
merge_mode: MergeMode,
|
||||
}
|
||||
|
||||
impl<'a> CompactionSstReaderBuilder<'a> {
|
||||
impl CompactionSstReaderBuilder<'_> {
|
||||
/// Builds [BoxedBatchReader] that reads all SST files and yields batches in primary key order.
|
||||
async fn build_sst_reader(self) -> Result<BoxedBatchReader> {
|
||||
let mut scan_input = ScanInput::new(self.sst_layer, ProjectionMapper::all(&self.metadata)?)
|
||||
|
||||
@@ -182,7 +182,7 @@ pub(crate) struct IndexerBuilder<'a> {
|
||||
pub(crate) bloom_filter_index_config: BloomFilterConfig,
|
||||
}
|
||||
|
||||
impl<'a> IndexerBuilder<'a> {
|
||||
impl IndexerBuilder<'_> {
|
||||
/// Sanity check for arguments and create a new [Indexer] if arguments are valid.
|
||||
pub(crate) async fn build(self) -> Indexer {
|
||||
let mut indexer = Indexer {
|
||||
|
||||
@@ -781,7 +781,7 @@ impl JsonLike for Value {
|
||||
if left.len() != right.len() {
|
||||
false
|
||||
} else {
|
||||
left.iter().zip(right).map(|(a, b)| a.eq(&b)).all(|a| a)
|
||||
left.iter().zip(right).all(|(a, b)| a.eq(&b))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,8 +27,8 @@ pub struct PuffinMetadataCache {
|
||||
cache: moka::sync::Cache<String, Arc<FileMetadata>>,
|
||||
}
|
||||
|
||||
fn puffin_metadata_weight(k: &String, v: &Arc<FileMetadata>) -> u32 {
|
||||
(k.as_bytes().len() + v.memory_usage()) as u32
|
||||
fn puffin_metadata_weight(k: &str, v: &Arc<FileMetadata>) -> u32 {
|
||||
(k.len() + v.memory_usage()) as u32
|
||||
}
|
||||
|
||||
impl PuffinMetadataCache {
|
||||
@@ -37,7 +37,7 @@ impl PuffinMetadataCache {
|
||||
Self {
|
||||
cache: moka::sync::CacheBuilder::new(capacity)
|
||||
.name("puffin_metadata")
|
||||
.weigher(puffin_metadata_weight)
|
||||
.weigher(|k: &String, v| puffin_metadata_weight(k, v))
|
||||
.eviction_listener(|k, v, _cause| {
|
||||
let size = puffin_metadata_weight(&k, &v);
|
||||
cache_bytes
|
||||
|
||||
@@ -244,11 +244,11 @@ impl MysqlInstanceShim {
|
||||
Ok((params, columns))
|
||||
}
|
||||
|
||||
async fn do_execute<'a>(
|
||||
async fn do_execute(
|
||||
&mut self,
|
||||
query_ctx: QueryContextRef,
|
||||
stmt_key: String,
|
||||
params: Params<'a>,
|
||||
params: Params<'_>,
|
||||
) -> Result<Vec<std::result::Result<Output, error::Error>>> {
|
||||
let sql_plan = match self.plan(&stmt_key) {
|
||||
None => {
|
||||
|
||||
@@ -122,7 +122,7 @@ impl PartialEq for OptionMap {
|
||||
other
|
||||
.secrets
|
||||
.get(key)
|
||||
.map_or(false, |v| value.expose_secret() == v.expose_secret())
|
||||
.is_some_and(|v| value.expose_secret() == v.expose_secret())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user