diff --git a/MODULE.bazel b/MODULE.bazel index be96dae3..8fe951e7 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -16,10 +16,9 @@ use_repo(zig_toolchains, "zig_sdk") rust = use_extension("@rules_rust//rust:extensions.bzl", "rust") rust.toolchain( edition = "2021", - versions = ["nightly/2023-12-06"], extra_target_triples = ["aarch64-unknown-linux-gnu"], + versions = ["nightly/2025-03-01"], ) - use_repo(rust, "rust_toolchains") register_toolchains("@rust_toolchains//:all") @@ -28,7 +27,6 @@ crate = use_extension( "@rules_rust//crate_universe:extension.bzl", "crate", ) - crate.from_cargo( name = "crates", cargo_lockfile = "Cargo.lock", @@ -49,12 +47,10 @@ crate.from_cargo( ], ) use_repo(crate, "crates") - crate.annotation( crate = "protoc-gen-prost", gen_binaries = ["protoc-gen-prost"], ) - crate.annotation( crate = "protoc-gen-tonic", gen_binaries = ["protoc-gen-tonic"], @@ -63,20 +59,16 @@ crate.annotation( register_toolchains("//:prost_toolchain") rules_ts_ext = use_extension("@aspect_rules_ts//ts:extensions.bzl", "ext", dev_dependency = True) - rules_ts_ext.deps( - ts_version_from = "//editors/code:package.json", ts_integrity = "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", + ts_version_from = "//editors/code:package.json", ) - use_repo(rules_ts_ext, "npm_typescript") npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm", dev_dependency = True) - npm.npm_translate_lock( name = "npm", pnpm_lock = "//editors/code:pnpm-lock.yaml", verify_node_modules_ignored = "//:.bazelignore", ) - use_repo(npm, "npm") diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 136f4205..21162e60 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -695,7 +695,7 @@ "@@aspect_rules_ts+//ts:extensions.bzl%ext": { "general": { "bzlTransitiveDigest": "9VDNRpxNfbh5LV9UNFhIOwWoRCpjVvxWTwrEnTV6Ars=", - "usagesDigest": "kZZTP60iq7EqWRByCrt37VTZCZJzjTT7tDnRboOGXUg=", + "usagesDigest": "lqMkWEFr0Ide9qoREucsAJvvoGl6JA2/TKRv5Xa3yx8=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, @@ -1001,15 +1001,15 @@ "@@rules_rust+//rust:extensions.bzl%rust": { "general": { "bzlTransitiveDigest": "2z4xwPAnNKEYo/ZCs4AbGgtuD1CGN394dNKvZPvvH/8=", - "usagesDigest": "JMI9Xl07UO21UOpErVWbqRwMPE3EGquPsGewzN/qgbc=", + "usagesDigest": "/dwZCMKoEziwMVnndnvf/LhAGgxgcI49fcYnBnthhS4=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, "generatedRepoSpecs": { - "rust_analyzer_nightly-2023-12-06_tools": { + "rust_analyzer_nightly-2025-03-01_tools": { "repoRuleId": "@@rules_rust+//rust:repositories.bzl%rust_analyzer_toolchain_tools_repository", "attributes": { - "version": "nightly/2023-12-06", + "version": "nightly/2025-03-01", "sha256s": {}, "urls": [ "https://static.rust-lang.org/dist/{}.tar.xz" @@ -1019,10 +1019,10 @@ "auth_patterns": [] } }, - "rust_analyzer_nightly-2023-12-06": { + "rust_analyzer_nightly-2025-03-01": { "repoRuleId": "@@rules_rust+//rust:repositories.bzl%toolchain_repository_proxy", "attributes": { - "toolchain": "@rust_analyzer_nightly-2023-12-06_tools//:rust_analyzer_toolchain", + "toolchain": "@rust_analyzer_nightly-2025-03-01_tools//:rust_analyzer_toolchain", "toolchain_type": "@rules_rust//rust/rust_analyzer:toolchain_type", "exec_compatible_with": [], "target_compatible_with": [] @@ -1035,7 +1035,7 @@ "allocator_library": "@rules_rust//ffi/cc/allocator_library", "global_allocator_library": "@rules_rust//ffi/cc/global_allocator_library", "target_triple": "aarch64-apple-darwin", - "version": "nightly/2023-12-06", + "version": "nightly/2025-03-01", "rustfmt_version": "nightly/2024-09-05", "edition": "2021", "dev_components": false, @@ -1076,7 +1076,7 @@ "allocator_library": "@rules_rust//ffi/cc/allocator_library", "global_allocator_library": "@rules_rust//ffi/cc/global_allocator_library", "target_triple": "aarch64-unknown-linux-gnu", - "version": "nightly/2023-12-06", + "version": "nightly/2025-03-01", "rustfmt_version": "nightly/2024-09-05", "edition": "2021", "dev_components": false, @@ -1153,7 +1153,7 @@ "allocator_library": "@rules_rust//ffi/cc/allocator_library", "global_allocator_library": "@rules_rust//ffi/cc/global_allocator_library", "target_triple": "aarch64-pc-windows-msvc", - "version": "nightly/2023-12-06", + "version": "nightly/2025-03-01", "rustfmt_version": "nightly/2024-09-05", "edition": "2021", "dev_components": false, @@ -1194,7 +1194,7 @@ "allocator_library": "@rules_rust//ffi/cc/allocator_library", "global_allocator_library": "@rules_rust//ffi/cc/global_allocator_library", "target_triple": "aarch64-unknown-linux-gnu", - "version": "nightly/2023-12-06", + "version": "nightly/2025-03-01", "rustfmt_version": "nightly/2024-09-05", "edition": "2021", "dev_components": false, @@ -1271,7 +1271,7 @@ "allocator_library": "@rules_rust//ffi/cc/allocator_library", "global_allocator_library": "@rules_rust//ffi/cc/global_allocator_library", "target_triple": "aarch64-unknown-linux-gnu", - "version": "nightly/2023-12-06", + "version": "nightly/2025-03-01", "rustfmt_version": "nightly/2024-09-05", "edition": "2021", "dev_components": false, @@ -1347,7 +1347,7 @@ "allocator_library": "@rules_rust//ffi/cc/allocator_library", "global_allocator_library": "@rules_rust//ffi/cc/global_allocator_library", "target_triple": "s390x-unknown-linux-gnu", - "version": "nightly/2023-12-06", + "version": "nightly/2025-03-01", "rustfmt_version": "nightly/2024-09-05", "edition": "2021", "dev_components": false, @@ -1388,7 +1388,7 @@ "allocator_library": "@rules_rust//ffi/cc/allocator_library", "global_allocator_library": "@rules_rust//ffi/cc/global_allocator_library", "target_triple": "aarch64-unknown-linux-gnu", - "version": "nightly/2023-12-06", + "version": "nightly/2025-03-01", "rustfmt_version": "nightly/2024-09-05", "edition": "2021", "dev_components": false, @@ -1465,7 +1465,7 @@ "allocator_library": "@rules_rust//ffi/cc/allocator_library", "global_allocator_library": "@rules_rust//ffi/cc/global_allocator_library", "target_triple": "x86_64-apple-darwin", - "version": "nightly/2023-12-06", + "version": "nightly/2025-03-01", "rustfmt_version": "nightly/2024-09-05", "edition": "2021", "dev_components": false, @@ -1506,7 +1506,7 @@ "allocator_library": "@rules_rust//ffi/cc/allocator_library", "global_allocator_library": "@rules_rust//ffi/cc/global_allocator_library", "target_triple": "aarch64-unknown-linux-gnu", - "version": "nightly/2023-12-06", + "version": "nightly/2025-03-01", "rustfmt_version": "nightly/2024-09-05", "edition": "2021", "dev_components": false, @@ -1583,7 +1583,7 @@ "allocator_library": "@rules_rust//ffi/cc/allocator_library", "global_allocator_library": "@rules_rust//ffi/cc/global_allocator_library", "target_triple": "x86_64-pc-windows-msvc", - "version": "nightly/2023-12-06", + "version": "nightly/2025-03-01", "rustfmt_version": "nightly/2024-09-05", "edition": "2021", "dev_components": false, @@ -1624,7 +1624,7 @@ "allocator_library": "@rules_rust//ffi/cc/allocator_library", "global_allocator_library": "@rules_rust//ffi/cc/global_allocator_library", "target_triple": "aarch64-unknown-linux-gnu", - "version": "nightly/2023-12-06", + "version": "nightly/2025-03-01", "rustfmt_version": "nightly/2024-09-05", "edition": "2021", "dev_components": false, @@ -1701,7 +1701,7 @@ "allocator_library": "@rules_rust//ffi/cc/allocator_library", "global_allocator_library": "@rules_rust//ffi/cc/global_allocator_library", "target_triple": "x86_64-unknown-freebsd", - "version": "nightly/2023-12-06", + "version": "nightly/2025-03-01", "rustfmt_version": "nightly/2024-09-05", "edition": "2021", "dev_components": false, @@ -1742,7 +1742,7 @@ "allocator_library": "@rules_rust//ffi/cc/allocator_library", "global_allocator_library": "@rules_rust//ffi/cc/global_allocator_library", "target_triple": "aarch64-unknown-linux-gnu", - "version": "nightly/2023-12-06", + "version": "nightly/2025-03-01", "rustfmt_version": "nightly/2024-09-05", "edition": "2021", "dev_components": false, @@ -1819,7 +1819,7 @@ "allocator_library": "@rules_rust//ffi/cc/allocator_library", "global_allocator_library": "@rules_rust//ffi/cc/global_allocator_library", "target_triple": "x86_64-unknown-linux-gnu", - "version": "nightly/2023-12-06", + "version": "nightly/2025-03-01", "rustfmt_version": "nightly/2024-09-05", "edition": "2021", "dev_components": false, @@ -1860,7 +1860,7 @@ "allocator_library": "@rules_rust//ffi/cc/allocator_library", "global_allocator_library": "@rules_rust//ffi/cc/global_allocator_library", "target_triple": "aarch64-unknown-linux-gnu", - "version": "nightly/2023-12-06", + "version": "nightly/2025-03-01", "rustfmt_version": "nightly/2024-09-05", "edition": "2021", "dev_components": false, @@ -1934,7 +1934,7 @@ "repoRuleId": "@@rules_rust+//rust/private:repository_utils.bzl%toolchain_repository_hub", "attributes": { "toolchain_names": [ - "rust_analyzer_nightly-2023-12-06", + "rust_analyzer_nightly-2025-03-01", "rust_darwin_aarch64__aarch64-apple-darwin__nightly", "rust_darwin_aarch64__aarch64-unknown-linux-gnu__nightly", "rustfmt_nightly-2024-09-05__aarch64-apple-darwin", @@ -1960,7 +1960,7 @@ "rustfmt_nightly-2024-09-05__x86_64-unknown-linux-gnu" ], "toolchain_labels": { - "rust_analyzer_nightly-2023-12-06": "@rust_analyzer_nightly-2023-12-06_tools//:rust_analyzer_toolchain", + "rust_analyzer_nightly-2025-03-01": "@rust_analyzer_nightly-2025-03-01_tools//:rust_analyzer_toolchain", "rust_darwin_aarch64__aarch64-apple-darwin__nightly": "@rust_darwin_aarch64__aarch64-apple-darwin__nightly_tools//:rust_toolchain", "rust_darwin_aarch64__aarch64-unknown-linux-gnu__nightly": "@rust_darwin_aarch64__aarch64-unknown-linux-gnu__nightly_tools//:rust_toolchain", "rustfmt_nightly-2024-09-05__aarch64-apple-darwin": "@rustfmt_nightly-2024-09-05__aarch64-apple-darwin_tools//:rustfmt_toolchain", @@ -1986,7 +1986,7 @@ "rustfmt_nightly-2024-09-05__x86_64-unknown-linux-gnu": "@rustfmt_nightly-2024-09-05__x86_64-unknown-linux-gnu_tools//:rustfmt_toolchain" }, "toolchain_types": { - "rust_analyzer_nightly-2023-12-06": "@rules_rust//rust/rust_analyzer:toolchain_type", + "rust_analyzer_nightly-2025-03-01": "@rules_rust//rust/rust_analyzer:toolchain_type", "rust_darwin_aarch64__aarch64-apple-darwin__nightly": "@rules_rust//rust:toolchain", "rust_darwin_aarch64__aarch64-unknown-linux-gnu__nightly": "@rules_rust//rust:toolchain", "rustfmt_nightly-2024-09-05__aarch64-apple-darwin": "@rules_rust//rust/rustfmt:toolchain_type", @@ -2012,7 +2012,7 @@ "rustfmt_nightly-2024-09-05__x86_64-unknown-linux-gnu": "@rules_rust//rust/rustfmt:toolchain_type" }, "exec_compatible_with": { - "rust_analyzer_nightly-2023-12-06": [], + "rust_analyzer_nightly-2025-03-01": [], "rust_darwin_aarch64__aarch64-apple-darwin__nightly": [ "@platforms//cpu:aarch64", "@platforms//os:osx" @@ -2107,7 +2107,7 @@ ] }, "target_compatible_with": { - "rust_analyzer_nightly-2023-12-06": [], + "rust_analyzer_nightly-2025-03-01": [], "rust_darwin_aarch64__aarch64-apple-darwin__nightly": [ "@platforms//cpu:aarch64", "@platforms//os:osx" diff --git a/crates/starpls/src/document.rs b/crates/starpls/src/document.rs index a8a73348..5f54f94f 100644 --- a/crates/starpls/src/document.rs +++ b/crates/starpls/src/document.rs @@ -363,7 +363,7 @@ impl DefaultFileLoader { Ok((file_id, contents)) } - fn repo_for_path<'a>(&'a self, path: &'a Path) -> Option<&str> { + fn repo_for_path<'a>(&'a self, path: &'a Path) -> Option<&'a str> { match path.strip_prefix(&self.external_output_base) { Ok(stripped) => stripped .components() diff --git a/crates/starpls_bazel/src/label.rs b/crates/starpls_bazel/src/label.rs index 3809f5d2..7544aa63 100644 --- a/crates/starpls_bazel/src/label.rs +++ b/crates/starpls_bazel/src/label.rs @@ -24,7 +24,7 @@ pub struct Label<'a> { } impl<'a> Label<'a> { - pub fn parse(input: &'a str) -> ParseResult { + pub fn parse(input: &'a str) -> ParseResult<'a> { Parser { chars: input.chars(), pos: 0, @@ -134,7 +134,7 @@ struct Parser<'a, 'b> { label: Label<'a>, } -impl<'a, 'b> Parser<'a, 'b> { +impl<'a> Parser<'a, '_> { fn parse(mut self) -> ParseResult<'a> { match self.parse_full() { Ok(_) => Ok(self.label), diff --git a/crates/starpls_hir/src/def/codeflow/pretty.rs b/crates/starpls_hir/src/def/codeflow/pretty.rs index 7acdb5c2..c39f4284 100644 --- a/crates/starpls_hir/src/def/codeflow/pretty.rs +++ b/crates/starpls_hir/src/def/codeflow/pretty.rs @@ -36,7 +36,7 @@ struct CodeFlowGraphPrettyCtx<'a> { indent: String, } -impl<'a> CodeFlowGraphPrettyCtx<'a> { +impl CodeFlowGraphPrettyCtx<'_> { fn pretty_print(mut self) -> String { wln!(&mut self.result, "def main():"); self.push_indent_level(); diff --git a/crates/starpls_hir/src/def/lower.rs b/crates/starpls_hir/src/def/lower.rs index 87c7bbee..4019c5df 100644 --- a/crates/starpls_hir/src/def/lower.rs +++ b/crates/starpls_hir/src/def/lower.rs @@ -71,7 +71,7 @@ struct LoweringContext<'a> { source_map: ModuleSourceMap, } -impl<'a> LoweringContext<'a> { +impl LoweringContext<'_> { fn lower(mut self, syntax: ast::Module) -> (Module, ModuleSourceMap) { let line_index = line_index(self.db, self.file); self.module.type_ignore_comment_lines = syntax diff --git a/crates/starpls_hir/src/def/resolver.rs b/crates/starpls_hir/src/def/resolver.rs index ba46cd3b..f6f4fda0 100644 --- a/crates/starpls_hir/src/def/resolver.rs +++ b/crates/starpls_hir/src/def/resolver.rs @@ -97,7 +97,7 @@ impl<'a> Resolver<'a> { pub(crate) fn resolve_name( &'a self, name: &'a Name, - ) -> Option<(ExecutionScopeId, impl Iterator> + '_)> { + ) -> Option<(ExecutionScopeId, impl Iterator> + 'a)> { let mut defs = self .scopes_with_id() .filter_map(move |(scope_id, scope)| { diff --git a/crates/starpls_hir/src/display.rs b/crates/starpls_hir/src/display.rs index 4d62ee9f..59e9ab69 100644 --- a/crates/starpls_hir/src/display.rs +++ b/crates/starpls_hir/src/display.rs @@ -54,7 +54,7 @@ pub struct DisplayWithDbWrapper<'a, T: DisplayWithDb + ?Sized> { alt: bool, } -impl<'a, T: DisplayWithDb> DisplayWithDbWrapper<'a, T> { +impl DisplayWithDbWrapper<'_, T> { pub fn alt(self) -> Self { Self { db: self.db, @@ -64,7 +64,7 @@ impl<'a, T: DisplayWithDb> DisplayWithDbWrapper<'a, T> { } } -impl<'a, T: DisplayWithDb> fmt::Display for DisplayWithDbWrapper<'a, T> { +impl fmt::Display for DisplayWithDbWrapper<'_, T> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { if self.alt { self.item.fmt_alt(self.db, f) diff --git a/crates/starpls_hir/src/typeck.rs b/crates/starpls_hir/src/typeck.rs index e2d7cd9a..bc9215f4 100644 --- a/crates/starpls_hir/src/typeck.rs +++ b/crates/starpls_hir/src/typeck.rs @@ -926,10 +926,9 @@ impl Param { HirDefParam::KwargsDict { .. } ) } - ParamInner::IntrinsicParam { parent, index } => matches!( - parent.params(db)[index], - IntrinsicFunctionParam::KwargsDict { .. } - ), + ParamInner::IntrinsicParam { parent, index } => { + matches!(parent.params(db)[index], IntrinsicFunctionParam::KwargsDict) + } ParamInner::BuiltinParam { parent, index } => matches!( parent.params(db)[index], BuiltinFunctionParam::KwargsDict { .. } @@ -1460,7 +1459,10 @@ pub(crate) struct Rule { } impl Rule { - pub(crate) fn attrs<'a>(&'a self, db: &'a dyn Db) -> impl Iterator { + pub(crate) fn attrs<'a>( + &'a self, + db: &'a dyn Db, + ) -> impl Iterator { // This chaining is done to put the `name` attribute first. let common = common_attributes_query(db); let mut common_attrs = match self.kind { @@ -1777,7 +1779,7 @@ struct TypeRefResolver<'a, 'b> { errors: Vec, } -impl<'a, 'b> TypeRefResolver<'a, 'b> { +impl TypeRefResolver<'_, '_> { fn resolve_type_ref(mut self, type_ref: &TypeRef) -> (Ty, Vec) { let ty = self.resolve_type_ref_inner(type_ref); (ty, self.errors) diff --git a/crates/starpls_hir/src/typeck/infer.rs b/crates/starpls_hir/src/typeck/infer.rs index 959a8283..dc276504 100644 --- a/crates/starpls_hir/src/typeck/infer.rs +++ b/crates/starpls_hir/src/typeck/infer.rs @@ -1662,7 +1662,7 @@ impl TyContext<'_> { continue; } } - FlowNode::Unreachable { .. } => Ty::never(), + FlowNode::Unreachable => Ty::never(), }; break Some(curr_node_ty); diff --git a/crates/starpls_ide/src/completions.rs b/crates/starpls_ide/src/completions.rs index 9cddae65..96177edf 100644 --- a/crates/starpls_ide/src/completions.rs +++ b/crates/starpls_ide/src/completions.rs @@ -233,7 +233,7 @@ pub(crate) fn completions( for candidate in db.list_load_candidates(&value, file_id).ok()?? { let start = TextSize::from( value - .rfind(&['/', ':', '@']) + .rfind(['/', ':', '@']) .map(|start| { if candidate.replace_trailing_slash { start @@ -569,7 +569,7 @@ impl CompletionContext { } fn strip_last_package_or_target(label: &str) -> &str { - if let Some(index) = label.rfind(&[':', '/']) { + if let Some(index) = label.rfind([':', '/']) { &label[..index + 1] } else { label diff --git a/crates/starpls_ide/src/find_references.rs b/crates/starpls_ide/src/find_references.rs index 3a3d9a71..525b67d4 100644 --- a/crates/starpls_ide/src/find_references.rs +++ b/crates/starpls_ide/src/find_references.rs @@ -23,7 +23,7 @@ struct FindReferencesHandler<'a> { locations: Vec, } -impl<'a> FindReferencesHandler<'a> { +impl FindReferencesHandler<'_> { fn handle(mut self) -> Vec { let name = self.name.clone(); let finder = Finder::new(name.as_str()); diff --git a/crates/starpls_ide/src/lib.rs b/crates/starpls_ide/src/lib.rs index b122b2d6..504b2b39 100644 --- a/crates/starpls_ide/src/lib.rs +++ b/crates/starpls_ide/src/lib.rs @@ -470,9 +470,11 @@ pub trait FileLoader: Send + Sync + 'static { /// Simple implementation of [`FileLoader`] backed by a HashMap. /// Mainly used for tests. +#[cfg(test)] #[derive(Default)] pub(crate) struct SimpleFileLoader(DashMap); +#[cfg(test)] impl SimpleFileLoader { #[cfg(test)] pub(crate) fn add_files_from_fixture(&self, db: &dyn Db, fixture: &Fixture) { @@ -491,6 +493,7 @@ impl SimpleFileLoader { } } +#[cfg(test)] impl FileLoader for SimpleFileLoader { fn resolve_path( &self, diff --git a/crates/starpls_intern/src/lib.rs b/crates/starpls_intern/src/lib.rs index 31382ede..45bc72db 100644 --- a/crates/starpls_intern/src/lib.rs +++ b/crates/starpls_intern/src/lib.rs @@ -202,6 +202,12 @@ impl InternStorage { } } +impl Default for InternStorage { + fn default() -> Self { + Self::new() + } +} + impl InternStorage { fn get(&self) -> &InternMap { self.map.get_or_init(DashMap::default) diff --git a/crates/starpls_parser/src/grammar/expressions.rs b/crates/starpls_parser/src/grammar/expressions.rs index fe4b8a41..4d12f98e 100644 --- a/crates/starpls_parser/src/grammar/expressions.rs +++ b/crates/starpls_parser/src/grammar/expressions.rs @@ -41,10 +41,7 @@ pub(crate) fn binary_expr( tokens: &[SyntaxKind], next: fn(&mut Parser) -> Option, ) -> Option { - let mut m = match next(p) { - Some(m) => m, - None => return None, - }; + let mut m = next(p)?; while tokens.contains(&p.current()) { let binary_marker = m.precede(p); @@ -88,10 +85,7 @@ fn and_expr(p: &mut Parser) -> Option { fn comparison_expr(p: &mut Parser) -> Option { const COMP_TOKENS: &[SyntaxKind] = &[T![==], T![!=], T![<], T![>], T![<=], T![>=], T![in]]; - let mut m = match bitwise_or_expr(p) { - Some(m) => m, - None => return None, - }; + let mut m = bitwise_or_expr(p)?; loop { let is_not_in = if COMP_TOKENS.contains(&p.current()) { @@ -150,10 +144,7 @@ fn unary_expr(p: &mut Parser) -> Option { /// Parses a function call, subscript expression, or member access. pub(crate) fn primary_expr(p: &mut Parser) -> Option { - let mut m = match operand_expr(p) { - Some(m) => m, - None => return None, - }; + let mut m = operand_expr(p)?; loop { let next = match p.current() { diff --git a/vendor/runfiles/src/lib.rs b/vendor/runfiles/src/lib.rs index 6391f923..5edddf8d 100644 --- a/vendor/runfiles/src/lib.rs +++ b/vendor/runfiles/src/lib.rs @@ -303,7 +303,7 @@ pub fn find_runfiles_dir() -> Result { while let Some(ancestor) = next { if ancestor .file_name() - .map_or(false, |f| f.to_string_lossy().ends_with(".runfiles")) + .is_some_and(|f| f.to_string_lossy().ends_with(".runfiles")) { return Ok(ancestor.to_path_buf()); }