Skip to content

Commit f959b3f

Browse files
authored
Merge pull request #60 from Roblox/gw/update-rust-toolchain
Update to Rust 1.86 toolchain, 2024 Edition
2 parents 6890dc8 + 33b641a commit f959b3f

15 files changed

+34
-25
lines changed

.github/workflows/format-code.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
jobs:
99
format-code:
1010
runs-on: "ubuntu-latest"
11-
container: rust:1.82
11+
container: rust:1.86
1212

1313
steps:
1414
- name: Checkout the code on merge

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
lint:
1111
runs-on: "ubuntu-latest"
12-
container: rust:1.82
12+
container: rust:1.86
1313

1414
steps:
1515
- uses: actions/checkout@v2

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
matrix:
1414
features: [""]
1515
runs-on: "ubuntu-latest"
16-
container: rust:1.82
16+
container: rust:1.86
1717

1818
steps:
1919
- uses: actions/checkout@v2
@@ -26,7 +26,7 @@ jobs:
2626
matrix:
2727
features: [""]
2828
runs-on: "ubuntu-latest"
29-
container: rust:1.82
29+
container: rust:1.86
3030
services:
3131
consul:
3232
image: consul:1.11.11

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
jobs:
77
test:
88
runs-on: ubuntu-latest
9-
container: rust:1.82
9+
container: rust:1.86
1010
services:
1111
consul:
1212
image: consul:1.11.11
@@ -25,7 +25,7 @@ jobs:
2525

2626
dry-run:
2727
runs-on: ubuntu-latest
28-
container: rust:1.82
28+
container: rust:1.86
2929

3030
steps:
3131
- uses: actions/checkout@v2
@@ -36,7 +36,7 @@ jobs:
3636
publish:
3737
needs: [test, dry-run]
3838
runs-on: ubuntu-latest
39-
container: rust:1.82
39+
container: rust:1.86
4040
environment: crates-publish
4141

4242
steps:

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## Unreleased
88

9+
## 0.11.0 - 2025-05-13
10+
- Update Rust toolchain to 1.86
11+
- Update crate Rust edition support to Rust 2024.
12+
913
## 0.10.0 - 2025-05-13
1014
- Supports registering multiple health checks. This breaks backward compatibility and drops supports to consul servers
1115
older than 0.5.0 that do not have this commit: [674be58e55f](https://github.com/hashicorp/consul/commit/674be58e55f3f2b1f1c64ef2f52bfbd577db0c7c)

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[package]
22
name = "rs-consul"
33
# Don't forget to update the readme with the new version!
4-
version = "0.10.0"
4+
version = "0.11.0"
55
authors = ["Roblox"]
6-
edition = "2021"
6+
edition = "2024"
77
description = "This crate provides access to a set of strongly typed apis to interact with consul (https://www.consul.io/)"
88
readme = "README.md"
99
repository = "https://github.com/Roblox/rs-consul"

examples/deregister_service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use rs_consul::{types::*, Config, Consul};
1+
use rs_consul::{Config, Consul, types::*};
22

33
#[tokio::main] // Enables async main
44
async fn main() {

examples/register_service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use rs_consul::{types::*, Config, Consul};
1+
use rs_consul::{Config, Consul, types::*};
22

33
#[tokio::main] // Enables async main
44
async fn main() {

rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.82
1+
1.86

src/errors.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ pub enum ConsulError {
6262
TimeoutExceeded(std::time::Duration),
6363

6464
/// Unable to resolve the service's instances in Consul.
65-
#[error("Unable to resolve service '{0}' to a concrete list of addresses and ports for its instances via consul.")]
65+
#[error(
66+
"Unable to resolve service '{0}' to a concrete list of addresses and ports for its instances via consul."
67+
)]
6668
ServiceInstanceResolutionFailed(String),
6769

6870
/// An error from ureq occurred.

src/hyper_wrapper.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ SOFTWARE.
2323
*/
2424
use hyper::Version;
2525
use opentelemetry::{
26+
KeyValue,
2627
global::{BoxedSpan, BoxedTracer},
2728
trace::{Span, Status, Tracer},
28-
KeyValue,
2929
};
3030

3131
/// Create an OpenTelemetry Span for the given HTTP request, according to the OpenTelemetry

src/lib.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ use base64::Engine;
4040
use http_body_util::combinators::BoxBody;
4141
use http_body_util::{Empty, Full};
4242
use hyper::body::Bytes;
43-
use hyper::{body::Buf, Method};
44-
use hyper_util::client::legacy::{connect::HttpConnector, Builder, Client};
43+
use hyper::{Method, body::Buf};
44+
use hyper_util::client::legacy::{Builder, Client, connect::HttpConnector};
4545
use serde::{Deserialize, Serialize};
4646
use slog_scope::{error, info};
4747
use tokio::time::timeout;
@@ -546,7 +546,8 @@ impl Consul {
546546
if sn.service.address.is_empty() {
547547
info!(
548548
"Consul service {service_name} instance had an empty Service address, with port:{port}",
549-
service_name = &sn.service.service, port = sn.service.port
549+
service_name = &sn.service.service,
550+
port = sn.service.port
550551
);
551552
sn.node.address
552553
} else {
@@ -637,7 +638,7 @@ impl Consul {
637638
req.uri(url)
638639
}
639640

640-
async fn execute_request<'a>(
641+
async fn execute_request(
641642
&self,
642643
req: http::request::Builder,
643644
body: BoxBody<Bytes, Infallible>,

src/lock.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ use http_body_util::combinators::BoxBody;
22
use hyper::body::Bytes;
33

44
use crate::{
5-
errors::ConsulError, Consul, CreateOrUpdateKeyRequest, LockRequest, LockWatchRequest,
6-
ReadKeyRequest, ReadKeyResponse, ResponseMeta, Result,
5+
Consul, CreateOrUpdateKeyRequest, LockRequest, LockWatchRequest, ReadKeyRequest,
6+
ReadKeyResponse, ResponseMeta, Result, errors::ConsulError,
77
};
88

99
/// Represents a lock against Consul.
@@ -100,7 +100,7 @@ impl Consul {
100100
/// - request - the [LockWatchRequest](consul::types::LockWatchRequest)
101101
/// # Errors:
102102
/// [ConsulError](consul::ConsulError) describes all possible errors returned by this api.
103-
pub async fn watch_lock<'a>(
103+
pub async fn watch_lock(
104104
&self,
105105
request: LockWatchRequest<'_>,
106106
) -> Result<ResponseMeta<Vec<ReadKeyResponse>>> {

src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::{types, QueryOptions};
1+
use crate::{QueryOptions, types};
22

33
pub(crate) fn add_query_option_params(
44
uri: &mut String,

tests/test_runner.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,11 @@ mod tests {
102102
"2.2.2.2".to_string(),
103103
"3.3.3.3".to_string(),
104104
];
105-
assert!(expected_addresses
106-
.iter()
107-
.all(|item| addresses.contains(item)));
105+
assert!(
106+
expected_addresses
107+
.iter()
108+
.all(|item| addresses.contains(item))
109+
);
108110

109111
let tags: Vec<String> = response
110112
.iter()

0 commit comments

Comments
 (0)