Skip to content

Commit d0c650e

Browse files
authored
chore(deps): Upgrade rust to 1.70.0 (#17585)
1 parent a164952 commit d0c650e

File tree

13 files changed

+27
-37
lines changed

13 files changed

+27
-37
lines changed

Cargo.lock

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/vector-buffers/src/variants/disk_v2/tests/model/sequencer.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,9 @@ impl<T> TrackedFuture<T> {
2525
where
2626
F: Future<Output = T> + Send + 'static,
2727
{
28-
let wrapped = async move { fut.await };
29-
3028
Self {
3129
polled_once: false,
32-
fut: spawn(wrapped.boxed()),
30+
fut: spawn(fut.boxed()),
3331
}
3432
}
3533

lib/vector-config/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ indexmap = { version = "1.9", default-features = false }
1818
inventory = { version = "0.3" }
1919
no-proxy = { version = "0.3.1", default-features = false, features = ["serialize"] }
2020
num-traits = { version = "0.2.15", default-features = false }
21-
once_cell = { version = "1", default-features = false }
2221
serde = { version = "1.0", default-features = false }
2322
serde_json = { version = "1.0", default-features = false, features = ["std"] }
2423
serde_with = { version = "2.3.2", default-features = false, features = ["std"] }

lib/vector-config/src/schema/parser/query.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
use std::{fs::File, io::BufReader, path::Path};
1+
use std::{fs::File, io::BufReader, path::Path, sync::OnceLock};
22

3-
use once_cell::sync::OnceCell;
43
use serde_json::Value;
54
use snafu::Snafu;
65
use vector_config_common::{
@@ -415,8 +414,8 @@ impl<'a> QueryableSchema for SimpleSchema<'a> {
415414
}
416415

417416
fn schema_to_simple_schema(schema: &Schema) -> SimpleSchema<'_> {
418-
static TRUE_SCHEMA_OBJECT: OnceCell<SchemaObject> = OnceCell::new();
419-
static FALSE_SCHEMA_OBJECT: OnceCell<SchemaObject> = OnceCell::new();
417+
static TRUE_SCHEMA_OBJECT: OnceLock<SchemaObject> = OnceLock::new();
418+
static FALSE_SCHEMA_OBJECT: OnceLock<SchemaObject> = OnceLock::new();
420419

421420
let schema_object = match schema {
422421
Schema::Bool(bool) => {

lib/vector-core/src/config/log_schema.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
use std::sync::OnceLock;
2+
13
use lookup::lookup_v2::{parse_target_path, OptionalValuePath};
24
use lookup::{owned_value_path, OwnedTargetPath, OwnedValuePath};
3-
use once_cell::sync::{Lazy, OnceCell};
5+
use once_cell::sync::Lazy;
46
use vector_config::configurable_component;
57

6-
static LOG_SCHEMA: OnceCell<LogSchema> = OnceCell::new();
8+
static LOG_SCHEMA: OnceLock<LogSchema> = OnceLock::new();
79
static LOG_SCHEMA_DEFAULT: Lazy<LogSchema> = Lazy::new(LogSchema::default);
810

911
/// Loads Log Schema from configurations and sets global schema. Once this is

lib/vector-core/src/metrics/mod.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ mod recency;
44
mod recorder;
55
mod storage;
66

7-
use std::time::Duration;
7+
use std::{sync::OnceLock, time::Duration};
88

99
use chrono::Utc;
1010
use metrics::Key;
1111
use metrics_tracing_context::TracingContextLayer;
1212
use metrics_util::layers::Layer;
13-
use once_cell::sync::OnceCell;
1413
use snafu::Snafu;
1514

1615
pub use self::ddsketch::{AgentDDSketch, BinMap, Config};
@@ -29,7 +28,7 @@ pub enum Error {
2928
TimeoutMustBePositive { timeout: f64 },
3029
}
3130

32-
static CONTROLLER: OnceCell<Controller> = OnceCell::new();
31+
static CONTROLLER: OnceLock<Controller> = OnceLock::new();
3332

3433
// Cardinality counter parameters, expose the internal metrics registry
3534
// cardinality. Useful for the end users to help understand the characteristics

lib/vector-core/src/metrics/recorder.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
use std::sync::{atomic::Ordering, Arc, RwLock};
2-
use std::time::Duration;
2+
use std::{cell::OnceCell, time::Duration};
33

44
use chrono::Utc;
55
use metrics::{Counter, Gauge, Histogram, Key, KeyName, Recorder, SharedString, Unit};
66
use metrics_util::{registry::Registry as MetricsRegistry, MetricKindMask};
7-
use once_cell::unsync::OnceCell;
87
use quanta::Clock;
98

109
use super::recency::{GenerationalStorage, Recency};

rust-toolchain.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "1.69.0"
2+
channel = "1.70.0"
33
profile = "default"

src/aws/mod.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pub mod region;
55
use std::future::Future;
66
use std::pin::Pin;
77
use std::sync::atomic::{AtomicUsize, Ordering};
8-
use std::sync::Arc;
8+
use std::sync::{Arc, OnceLock};
99
use std::task::{Context, Poll};
1010
use std::time::SystemTime;
1111

@@ -26,7 +26,6 @@ use aws_types::credentials::{ProvideCredentials, SharedCredentialsProvider};
2626
use aws_types::region::Region;
2727
use aws_types::SdkConfig;
2828
use bytes::Bytes;
29-
use once_cell::sync::OnceCell;
3029
use regex::RegexSet;
3130
pub use region::RegionOrEndpoint;
3231
use tower::{Layer, Service, ServiceBuilder};
@@ -36,7 +35,7 @@ use crate::http::{build_proxy_connector, build_tls_connector};
3635
use crate::internal_events::AwsBytesSent;
3736
use crate::tls::{MaybeTlsSettings, TlsConfig};
3837

39-
static RETRIABLE_CODES: OnceCell<RegexSet> = OnceCell::new();
38+
static RETRIABLE_CODES: OnceLock<RegexSet> = OnceLock::new();
4039

4140
pub fn is_retriable_error<T>(error: &SdkError<T>) -> bool {
4241
match error {

src/sinks/util/service.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,6 @@ impl TowerRequestSettings {
357357
S::Future: Send + 'static,
358358
{
359359
let policy = self.retry_policy(retry_logic.clone());
360-
let settings = self.clone();
361360

362361
// Build services
363362
let open = OpenGauge::new();
@@ -368,16 +367,14 @@ impl TowerRequestSettings {
368367
// Build individual service
369368
ServiceBuilder::new()
370369
.layer(AdaptiveConcurrencyLimitLayer::new(
371-
settings.concurrency,
372-
settings.adaptive_concurrency,
370+
self.concurrency,
371+
self.adaptive_concurrency,
373372
retry_logic.clone(),
374373
))
375374
.service(
376375
health_config.build(
377376
health_logic.clone(),
378-
ServiceBuilder::new()
379-
.timeout(settings.timeout)
380-
.service(inner),
377+
ServiceBuilder::new().timeout(self.timeout).service(inner),
381378
open.clone(),
382379
endpoint,
383380
), // NOTE: there is a version conflict for crate `tracing` between `tracing_tower` crate

src/sources/kafka.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::{
22
collections::{BTreeMap, HashMap},
33
io::Cursor,
4-
sync::Arc,
4+
sync::{Arc, OnceLock},
55
time::Duration,
66
};
77

@@ -14,7 +14,6 @@ use codecs::{
1414
};
1515
use futures::{Stream, StreamExt};
1616
use lookup::{lookup_v2::OptionalValuePath, owned_value_path, path, OwnedValuePath};
17-
use once_cell::sync::OnceCell;
1817
use rdkafka::{
1918
consumer::{CommitMode, Consumer, ConsumerContext, Rebalance, StreamConsumer},
2019
message::{BorrowedMessage, Headers as _, Message},
@@ -724,7 +723,7 @@ fn create_consumer(config: &KafkaSourceConfig) -> crate::Result<StreamConsumer<C
724723
#[derive(Default)]
725724
struct CustomContext {
726725
stats: kafka::KafkaStatisticsContext,
727-
finalizer: OnceCell<Arc<OrderedFinalizer<FinalizerEntry>>>,
726+
finalizer: OnceLock<Arc<OrderedFinalizer<FinalizerEntry>>>,
728727
}
729728

730729
impl CustomContext {

src/trace.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@ use std::{
55
str::FromStr,
66
sync::{
77
atomic::{AtomicBool, Ordering},
8-
Mutex, MutexGuard,
8+
Mutex, MutexGuard, OnceLock,
99
},
1010
};
1111

1212
use futures_util::{future::ready, Stream, StreamExt};
1313
use lookup::event_path;
1414
use metrics_tracing_context::MetricsLayer;
15-
use once_cell::sync::OnceCell;
1615
use tokio::sync::{
1716
broadcast::{self, Receiver, Sender},
1817
oneshot,
@@ -51,7 +50,7 @@ static SUBSCRIBERS: Mutex<Option<Vec<oneshot::Sender<Vec<LogEvent>>>>> =
5150

5251
/// SENDER holds the sender/receiver handle that will receive a copy of all the internal log events *after* the topology
5352
/// has been initialized.
54-
static SENDER: OnceCell<Sender<LogEvent>> = OnceCell::new();
53+
static SENDER: OnceLock<Sender<LogEvent>> = OnceLock::new();
5554

5655
fn metrics_layer_enabled() -> bool {
5756
!matches!(std::env::var("DISABLE_INTERNAL_METRICS_TRACING_INTEGRATION"), Ok(x) if x == "true")

vdev/src/app.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
use std::ffi::{OsStr, OsString};
22
pub use std::process::Command;
33
use std::{
4-
borrow::Cow, env, io::Read, path::PathBuf, process::ExitStatus, process::Stdio, time::Duration,
4+
borrow::Cow, env, io::Read, path::PathBuf, process::ExitStatus, process::Stdio, sync::OnceLock,
5+
time::Duration,
56
};
67

78
use anyhow::{bail, Context as _, Result};
89
use indicatif::{ProgressBar, ProgressStyle};
910
use log::LevelFilter;
10-
use once_cell::sync::{Lazy, OnceCell};
11+
use once_cell::sync::Lazy;
1112

1213
use crate::{config::Config, git, platform, util};
1314

@@ -25,9 +26,9 @@ const DEFAULT_SHELL: &str = "/bin/sh";
2526
pub static SHELL: Lazy<OsString> =
2627
Lazy::new(|| (env::var_os("SHELL").unwrap_or_else(|| DEFAULT_SHELL.into())));
2728

28-
static VERBOSITY: OnceCell<LevelFilter> = OnceCell::new();
29-
static CONFIG: OnceCell<Config> = OnceCell::new();
30-
static PATH: OnceCell<String> = OnceCell::new();
29+
static VERBOSITY: OnceLock<LevelFilter> = OnceLock::new();
30+
static CONFIG: OnceLock<Config> = OnceLock::new();
31+
static PATH: OnceLock<String> = OnceLock::new();
3132

3233
pub fn verbosity() -> &'static LevelFilter {
3334
VERBOSITY.get().expect("verbosity is not initialized")

0 commit comments

Comments
 (0)