Skip to content

Commit 42dcea0

Browse files
Bump MSRV to 1.84 (#12670)
## Summary Closes #12649.
1 parent 420fc28 commit 42dcea0

File tree

64 files changed

+161
-143
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+161
-143
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ resolver = "2"
1212

1313
[workspace.package]
1414
edition = "2021"
15-
rust-version = "1.83"
15+
rust-version = "1.84"
1616
homepage = "https://pypi.org/project/uv/"
1717
documentation = "https://pypi.org/project/uv/"
1818
repository = "https://github.com/astral-sh/uv"

crates/uv-auth/src/credentials.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ impl Credentials {
131131
// Ensure the username matches if provided
132132
if username.is_some_and(|username| username != entry.login) {
133133
return None;
134-
};
134+
}
135135

136136
Some(Credentials::Basic {
137137
username: Username::new(Some(entry.login.clone())),

crates/uv-auth/src/middleware.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ impl AuthMiddleware {
361361
{
362362
trace!("Updating cached credentials for {url} to {credentials:?}");
363363
self.cache().insert(&url, credentials);
364-
};
364+
}
365365

366366
result
367367
}
@@ -449,7 +449,7 @@ impl AuthMiddleware {
449449
trace!("Using credentials from previous fetch for {url}");
450450
} else {
451451
trace!("Skipping fetch of credentials for {url}, previous attempt failed");
452-
};
452+
}
453453

454454
return credentials;
455455
}
@@ -513,14 +513,14 @@ fn tracing_url(request: &Request, credentials: Option<&Credentials>) -> String {
513513
.and_then(|credentials| credentials.username())
514514
{
515515
let _ = url.set_username(username);
516-
};
516+
}
517517
if credentials
518518
.as_ref()
519519
.and_then(|credentials| credentials.password())
520520
.is_some()
521521
{
522522
let _ = url.set_password(Some("****"));
523-
};
523+
}
524524
url.to_string()
525525
} else {
526526
request.url().to_string()

crates/uv-build-backend/src/metadata.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use std::collections::{BTreeMap, Bound};
22
use std::ffi::OsStr;
33
use std::fmt::Display;
4+
use std::fmt::Write;
45
use std::path::{Path, PathBuf};
56
use std::str::FromStr;
67

@@ -603,7 +604,7 @@ impl PyProjectToml {
603604
return Err(ValidationError::InvalidGroup(group.to_string()));
604605
}
605606

606-
writer.push_str(&format!("[{group}]\n"));
607+
let _ = writeln!(writer, "[{group}]");
607608
for (name, object_reference) in entries {
608609
// More strict than the spec, we enforce the recommendation
609610
if !name
@@ -614,7 +615,7 @@ impl PyProjectToml {
614615
}
615616

616617
// TODO(konsti): Validate that the object references are valid Python identifiers.
617-
writer.push_str(&format!("{name} = {object_reference}\n"));
618+
let _ = writeln!(writer, "{name} = {object_reference}");
618619
}
619620
writer.push('\n');
620621
Ok(())
@@ -963,7 +964,7 @@ mod tests {
963964
fn format_err(err: impl std::error::Error) -> String {
964965
let mut formatted = err.to_string();
965966
for source in iter::successors(err.source(), |&err| err.source()) {
966-
formatted += &format!("\n Caused by: {source}");
967+
let _ = write!(formatted, "\n Caused by: {source}");
967968
}
968969
formatted
969970
}

crates/uv-build-backend/src/source_dist.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ fn write_source_dist(
231231
if !include_matcher.match_path(relative) || exclude_matcher.is_match(relative) {
232232
trace!("Excluding: `{}`", relative.user_display());
233233
continue;
234-
};
234+
}
235235

236236
debug!("Including {}", relative.user_display());
237237
if entry.file_type().is_dir() {

crates/uv-build-backend/src/wheel.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ fn wheel_subdir_from_globs(
560560
if !matcher.match_path(relative) {
561561
trace!("Excluding {}: `{}`", globs_field, relative.user_display());
562562
continue;
563-
};
563+
}
564564

565565
let relative_licenses = Path::new(target)
566566
.join(relative)

crates/uv-build-frontend/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ impl SourceBuild {
568568
nor `setup.cfg` are present in the directory",
569569
source_tree.simplified_display().cyan(),
570570
);
571-
};
571+
}
572572
}
573573
default_backend.clone()
574574
};

crates/uv-client/src/base_client.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1+
use std::error::Error;
2+
use std::fmt::Debug;
3+
use std::fmt::Write;
4+
use std::path::Path;
5+
use std::sync::Arc;
6+
use std::time::Duration;
7+
use std::{env, iter};
8+
19
use itertools::Itertools;
210
use reqwest::{Client, ClientBuilder, Proxy, Response};
311
use reqwest_middleware::{ClientWithMiddleware, Middleware};
412
use reqwest_retry::policies::ExponentialBackoff;
513
use reqwest_retry::{
614
DefaultRetryableStrategy, RetryTransientMiddleware, Retryable, RetryableStrategy,
715
};
8-
use std::error::Error;
9-
use std::fmt::Debug;
10-
use std::path::Path;
11-
use std::sync::Arc;
12-
use std::time::Duration;
13-
use std::{env, iter};
1416
use tracing::{debug, trace};
1517
use url::Url;
18+
1619
use uv_auth::{AuthMiddleware, UrlAuthPolicies};
1720
use uv_configuration::{KeyringProviderType, TrustedHost};
1821
use uv_fs::Simplified;
@@ -186,7 +189,7 @@ impl<'a> BaseClientBuilder<'a> {
186189
if let Some(markers) = self.markers {
187190
let linehaul = LineHaul::new(markers, self.platform);
188191
if let Ok(output) = serde_json::to_string(&linehaul) {
189-
user_agent_string += &format!(" {output}");
192+
let _ = write!(user_agent_string, " {output}");
190193
}
191194
}
192195

crates/uv-client/src/html.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ impl SimpleHtml {
130130
// the final path component of the URL.
131131
let filename = path
132132
.split('/')
133-
.last()
133+
.next_back()
134134
.ok_or_else(|| Error::MissingFilename(href.to_string()))?;
135135

136136
// Strip any query string from the filename.

crates/uv-client/src/httpcache/control.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,9 +415,8 @@ impl<'b, B: 'b + ?Sized + AsRef<[u8]>, I: Iterator<Item = &'b B>> Iterator
415415
self.skip_whitespace();
416416
self.maybe_parse_directive_delimiter();
417417
let directive = CacheControlDirective { name, value };
418-
match self.emit_directive(directive) {
419-
None => continue,
420-
Some(d) => return Some(d),
418+
if let Some(d) = self.emit_directive(directive) {
419+
return Some(d);
421420
}
422421
}
423422
}

0 commit comments

Comments
 (0)