Skip to content

Commit

Permalink
chore: update to Rust 1.85.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ognevny committed Feb 25, 2025
1 parent 21fe2bc commit d1e4412
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 14 deletions.
1 change: 0 additions & 1 deletion crates/turborepo-api-client/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(async_closure)]
#![feature(error_generic_member_access)]
#![feature(assert_matches)]
#![deny(clippy::all)]
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-auth/src/auth/sso.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ pub async fn sso_login<T: Client + TokenClient + CacheClient>(
api_client,
sso_team,
Some(valid_token_callback(
"Existing Vercel token for {sso_team} found!",
&format!("Existing Vercel token for {sso_team} found!"),
color_config,
)),
)
Expand Down
3 changes: 1 addition & 2 deletions crates/turborepo-auth/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,7 @@ fn is_token_active(metadata: &ResponseTokenMetadata, current_time: u128) -> bool
// Not all scopes have an expiration date, so we need to check if all of them
// are expired. If there isn't an expiration date, we assume they are infinite
// and therefore cannot be expired.
let all_scopes_active =
earliest_expiration.map_or(true, |expiration| current_time < expiration);
let all_scopes_active = earliest_expiration.is_none_or(|expiration| current_time < expiration);

all_scopes_active && (active_at <= current_time)
}
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-globwatch/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ impl GlobWatcher {
// requester. flushes should not be considered as events.
for flush_id in e
.paths
.extract_if(|p| p.starts_with(flush_dir.as_path()))
.extract_if(.., |p| p.starts_with(flush_dir.as_path()))
.filter_map(|p| {
get_flush_id(
p.strip_prefix(flush_dir.as_path())
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-lib/src/query/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ impl RepositoryQuery {
let Ok(package) = package.as_ref() else {
return true;
};
filter.as_ref().map_or(true, |f| f.check(&package.package))
filter.as_ref().is_none_or(|f| f.check(&package.package))
})
.collect::<Result<Array<_>, _>>()?;

Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-lib/src/run/task_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ impl<'a> TaskName<'a> {

pub fn in_workspace(&self, workspace: &str) -> bool {
self.task_id()
.map_or(true, |task_id| task_id.package() == workspace)
.is_none_or(|task_id| task_id.package() == workspace)
}

pub fn into_owned(self) -> TaskName<'static> {
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-lib/src/task_graph/visitor/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ impl<'a> CommandProvider for PackageGraphCommandProvider<'a> {
.package_json
.scripts
.get(task_id.task())
.map_or(true, |script| script.is_empty())
.is_none_or(|script| script.is_empty())
{
return Ok(None);
}
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-lib/src/turbo_json/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ impl TryFrom<RawTaskDefinition> for TaskDefinition {
fn try_from(raw_task: RawTaskDefinition) -> Result<Self, Error> {
let outputs = raw_task.outputs.unwrap_or_default().try_into()?;

let cache = raw_task.cache.map_or(true, |c| c.into_inner());
let cache = raw_task.cache.is_none_or(|c| c.into_inner());
let interactive = raw_task
.interactive
.as_ref()
Expand Down
4 changes: 1 addition & 3 deletions crates/turborepo-lockfiles/src/berry/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,9 +440,7 @@ impl Lockfile for BerryLockfile {
.locator_for_workspace_path(workspace_path)
.ok_or_else(|| crate::Error::MissingWorkspace(workspace_path.to_string()))?;

let dependency = self
.resolve_dependency(workspace_locator, name, version)
.map_err(Error::from)?;
let dependency = self.resolve_dependency(workspace_locator, name, version)?;

let Some(locator) = self.resolutions.get(&dependency) else {
return Ok(None);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ impl<'a> DependencyVersion<'a> {
constraint
.ok()
.zip(version.ok())
.map_or(true, |(constraint, version)| constraint.satisfies(&version))
.is_none_or(|(constraint, version)| constraint.satisfies(&version))
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "nightly-2024-11-22"
channel = "nightly-2025-01-03"
components = ["rustfmt", "clippy"]
profile = "minimal"

0 comments on commit d1e4412

Please sign in to comment.