Skip to content

Commit

Permalink
bump rust-toolchain to 1.80.0
Browse files Browse the repository at this point in the history
replace once_cell::sync::Lazy with std::sync::LazyLock
remove unused types MetricLine, TlsCluster, StatePath
remove unused field QueryClustersTask::request_type
  • Loading branch information
Keksoj committed Aug 1, 2024
1 parent 57399e0 commit e48b26d
Show file tree
Hide file tree
Showing 12 changed files with 396 additions and 264 deletions.
616 changes: 387 additions & 229 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ authors = [
]
categories = ["network-programming"]
edition = "2021"
rust-version = "1.74.0"
rust-version = "1.80.0"
include = ["README.md", "Cargo.toml", "src/**/*"]

[dependencies]
Expand Down
2 changes: 0 additions & 2 deletions bin/src/command/requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ fn subscribe_client_to_events(server: &mut Server, client: &mut ClientSession) {
#[derive(Debug)]
pub struct QueryClustersTask {
pub client_token: Token,
pub request_type: RequestType,
pub gatherer: DefaultGatherer,
main_process_response: Option<ResponseContent>,
}
Expand All @@ -276,7 +275,6 @@ pub fn query_clusters(
client_token: client.token,
gatherer: DefaultGatherer::default(),
main_process_response: server.query_main(request_content.clone()),
request_type: request_content,
}),
Timeout::Default,
None,
Expand Down
2 changes: 1 addition & 1 deletion command/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ authors = [
]
categories = ["network-programming"]
edition = "2021"
rust-version = "1.74.0"
rust-version = "1.80.0"
include = [
"./README.md",
"Cargo.toml",
Expand Down
5 changes: 0 additions & 5 deletions command/src/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,6 @@ impl fmt::Display for RunState {
}
}

#[derive(Serialize)]
struct StatePath {
path: String,
}

pub type MessageId = String;

impl WorkerResponse {
Expand Down
2 changes: 1 addition & 1 deletion e2e/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "sozu-e2e"
version = "1.0.1"
rust-version = "1.74.0"
rust-version = "1.80.0"
edition = "2021"

[dependencies]
Expand Down
6 changes: 2 additions & 4 deletions lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ authors = [
]
categories = ["network-programming"]
edition = "2021"
rust-version = "1.74.0"
rust-version = "1.80.0"
include = [
"./README.md",
"Cargo.toml",
Expand All @@ -33,7 +33,7 @@ cookie-factory = "^0.3.3"
hdrhistogram = "^7.5.4"
hex = "^0.4.3"
hpack = "^0.3.0"
idna = "^0.5.0"
idna = "^1.0.2"
kawa = { version = "^0.6.6", default-features = false }
libc = "^0.2.155"
memchr = "^2.7.2"
Expand All @@ -50,8 +50,6 @@ slab = "^0.4.9"
socket2 = { version = "^0.5.7", features = ["all"] }
thiserror = "^1.0.61"
time = "^0.3.36"
once_cell = "1.19.0"

sozu-command-lib = { path = "../command", version = "^1.0.4" }

[dev-dependencies]
Expand Down
7 changes: 0 additions & 7 deletions lib/src/https.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,6 @@ use crate::{
// const SERVER_PROTOS: &[&str] = &["http/1.1", "h2"];
const SERVER_PROTOS: &[&str] = &["http/1.1"];

#[derive(Debug, Clone, PartialEq, Eq)]
pub struct TlsCluster {
cluster_id: String,
hostname: String,
path_begin: String,
}

StateMachineBuilder! {
/// The various Stages of an HTTPS connection:
///
Expand Down
9 changes: 0 additions & 9 deletions lib/src/metrics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,15 +265,6 @@ impl Subscriber for Aggregator {
}
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub struct MetricLine {
label: &'static str,
cluster_id: Option<String>,
backend_id: Option<String>,
/// in milliseconds
duration: usize,
}

pub struct MetricSocket {
pub addr: SocketAddr,
pub socket: UdpSocket,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/timer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ mod test {
let mut t = timer();

t.set_timeout_at(Duration::from_millis(100), "a");
t.set_timeout_at(Duration::from_millis((100 + TICK * SLOTS as u64)), "b");
t.set_timeout_at(Duration::from_millis(100 + TICK * SLOTS as u64), "b");

let mut tick = ms_to_tick(&t, 100);
assert_eq!(Some("a"), t.poll_to(tick));
Expand Down
5 changes: 2 additions & 3 deletions lib/src/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ use std::{
fmt,
io::BufReader,
str::FromStr,
sync::{Arc, Mutex},
sync::{Arc, LazyLock, Mutex},
};

use once_cell::sync::Lazy;
use rustls::{
crypto::ring::sign::any_supported_type,
pki_types::{CertificateDer, PrivateKeyDer},
Expand All @@ -33,7 +32,7 @@ use crate::router::trie::{Key, KeyValue, TrieNode};
// -----------------------------------------------------------------------------
// Default ParsedCertificateAndKey

static DEFAULT_CERTIFICATE: Lazy<Option<Arc<CertifiedKey>>> = Lazy::new(|| {
static DEFAULT_CERTIFICATE: LazyLock<Option<Arc<CertifiedKey>>> = LazyLock::new(|| {
let add = AddCertificate {
certificate: CertificateAndKey {
certificate: include_str!("../assets/certificate.pem").to_string(),
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.74.0
1.80.0

0 comments on commit e48b26d

Please sign in to comment.