dart-decimate 0.0.35 → 0.0.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Cargo.lock CHANGED
@@ -4,9 +4,9 @@ version = 4
4
4
 
5
5
  [[package]]
6
6
  name = "aho-corasick"
7
- version = "1.1.4"
7
+ version = "1.1.5"
8
8
  source = "registry+https://github.com/rust-lang/crates.io-index"
9
- checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301"
9
+ checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba"
10
10
  dependencies = [
11
11
  "memchr",
12
12
  ]
@@ -19,15 +19,15 @@ checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000"
19
19
 
20
20
  [[package]]
21
21
  name = "bitflags"
22
- version = "2.13.0"
22
+ version = "2.13.1"
23
23
  source = "registry+https://github.com/rust-lang/crates.io-index"
24
- checksum = "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8"
24
+ checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da"
25
25
 
26
26
  [[package]]
27
27
  name = "bstr"
28
- version = "1.12.3"
28
+ version = "1.13.1"
29
29
  source = "registry+https://github.com/rust-lang/crates.io-index"
30
- checksum = "5cee35f73844aa3014bb606320a6c1f010249dbdf43342fe54b5a4f6a8ed4b79"
30
+ checksum = "6bb31b46c14244e20ee9984b11bf5c992b91fb6939fea616e3512c8baecdbe5f"
31
31
  dependencies = [
32
32
  "memchr",
33
33
  "serde_core",
@@ -35,9 +35,9 @@ dependencies = [
35
35
 
36
36
  [[package]]
37
37
  name = "cc"
38
- version = "1.2.65"
38
+ version = "1.4.4"
39
39
  source = "registry+https://github.com/rust-lang/crates.io-index"
40
- checksum = "e228eec9be7c17ccb640b59b36a5cd805ea2a564a4c5e162c2f659fea30d3b96"
40
+ checksum = "0ad534f4357a5264cce5019c989cf66a4f0dc4e0d1b1d15f8aacec0ff7360273"
41
41
  dependencies = [
42
42
  "find-msvc-tools",
43
43
  "shlex",
@@ -77,9 +77,9 @@ checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9"
77
77
 
78
78
  [[package]]
79
79
  name = "crossbeam-deque"
80
- version = "0.8.6"
80
+ version = "0.8.7"
81
81
  source = "registry+https://github.com/rust-lang/crates.io-index"
82
- checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51"
82
+ checksum = "5181e0de7b61eb03a81e347d6dd8797bae9da5146707b51077e2d71a54ec0ceb"
83
83
  dependencies = [
84
84
  "crossbeam-epoch",
85
85
  "crossbeam-utils",
@@ -96,13 +96,13 @@ dependencies = [
96
96
 
97
97
  [[package]]
98
98
  name = "crossbeam-utils"
99
- version = "0.8.21"
99
+ version = "0.8.22"
100
100
  source = "registry+https://github.com/rust-lang/crates.io-index"
101
- checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
101
+ checksum = "61803da095bee82a81bb1a452ecc25d3b2f1416d1897eb86430c6159ef717c17"
102
102
 
103
103
  [[package]]
104
104
  name = "dart-decimate"
105
- version = "0.0.35"
105
+ version = "0.0.37"
106
106
  dependencies = [
107
107
  "clap",
108
108
  "glob",
@@ -121,9 +121,9 @@ dependencies = [
121
121
 
122
122
  [[package]]
123
123
  name = "either"
124
- version = "1.16.0"
124
+ version = "1.18.0"
125
125
  source = "registry+https://github.com/rust-lang/crates.io-index"
126
- checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e"
126
+ checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34"
127
127
 
128
128
  [[package]]
129
129
  name = "equivalent"
@@ -143,15 +143,15 @@ dependencies = [
143
143
 
144
144
  [[package]]
145
145
  name = "fastrand"
146
- version = "2.4.1"
146
+ version = "2.5.0"
147
147
  source = "registry+https://github.com/rust-lang/crates.io-index"
148
- checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6"
148
+ checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223"
149
149
 
150
150
  [[package]]
151
151
  name = "find-msvc-tools"
152
- version = "0.1.9"
152
+ version = "0.1.11"
153
153
  source = "registry+https://github.com/rust-lang/crates.io-index"
154
- checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582"
154
+ checksum = "d45db016d36b838f563236e9193d0ee6ce38f3f68b6c94e914b4929c96bbb890"
155
155
 
156
156
  [[package]]
157
157
  name = "fixedbitset"
@@ -184,9 +184,9 @@ checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b"
184
184
 
185
185
  [[package]]
186
186
  name = "globset"
187
- version = "0.4.18"
187
+ version = "0.4.19"
188
188
  source = "registry+https://github.com/rust-lang/crates.io-index"
189
- checksum = "52dfc19153a48bde0cbd630453615c8151bce3a5adfac7a0aebfbf0a1e1f57e3"
189
+ checksum = "e47d37d2ae4464254884b60ab7071be2b876a9c35b696bd018ddcc76847309cd"
190
190
  dependencies = [
191
191
  "aho-corasick",
192
192
  "bstr",
@@ -228,9 +228,9 @@ dependencies = [
228
228
 
229
229
  [[package]]
230
230
  name = "indexmap"
231
- version = "2.14.0"
231
+ version = "2.14.1"
232
232
  source = "registry+https://github.com/rust-lang/crates.io-index"
233
- checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9"
233
+ checksum = "07aa2048142242915a31d35844fb311e0e53fcca590c3a0a40dcf1b841fa09eb"
234
234
  dependencies = [
235
235
  "equivalent",
236
236
  "hashbrown 0.17.1",
@@ -244,9 +244,9 @@ checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
244
244
 
245
245
  [[package]]
246
246
  name = "libc"
247
- version = "0.2.186"
247
+ version = "0.2.189"
248
248
  source = "registry+https://github.com/rust-lang/crates.io-index"
249
- checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66"
249
+ checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2"
250
250
 
251
251
  [[package]]
252
252
  name = "linux-raw-sys"
@@ -256,15 +256,15 @@ checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53"
256
256
 
257
257
  [[package]]
258
258
  name = "log"
259
- version = "0.4.33"
259
+ version = "0.4.34"
260
260
  source = "registry+https://github.com/rust-lang/crates.io-index"
261
- checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad"
261
+ checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6"
262
262
 
263
263
  [[package]]
264
264
  name = "memchr"
265
- version = "2.8.2"
265
+ version = "2.8.3"
266
266
  source = "registry+https://github.com/rust-lang/crates.io-index"
267
- checksum = "88904434abc2901f197fe8cc55f0445e7ded921dba5911dad2e2b39b48e663c4"
267
+ checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
268
268
 
269
269
  [[package]]
270
270
  name = "once_cell"
@@ -286,18 +286,18 @@ dependencies = [
286
286
 
287
287
  [[package]]
288
288
  name = "proc-macro2"
289
- version = "1.0.106"
289
+ version = "1.0.107"
290
290
  source = "registry+https://github.com/rust-lang/crates.io-index"
291
- checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
291
+ checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
292
292
  dependencies = [
293
293
  "unicode-ident",
294
294
  ]
295
295
 
296
296
  [[package]]
297
297
  name = "quote"
298
- version = "1.0.46"
298
+ version = "1.0.47"
299
299
  source = "registry+https://github.com/rust-lang/crates.io-index"
300
- checksum = "dfbc457d0c7a0759a614551b11a6409e5951f6c7537be1f1b7682b9ae9230368"
300
+ checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
301
301
  dependencies = [
302
302
  "proc-macro2",
303
303
  ]
@@ -330,9 +330,9 @@ dependencies = [
330
330
 
331
331
  [[package]]
332
332
  name = "regex"
333
- version = "1.12.4"
333
+ version = "1.13.1"
334
334
  source = "registry+https://github.com/rust-lang/crates.io-index"
335
- checksum = "f1292b7759ae1cb9ec195452d1390a074f0cd8541ab7a5a8c31cd6db45d4a6ba"
335
+ checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d"
336
336
  dependencies = [
337
337
  "aho-corasick",
338
338
  "memchr",
@@ -342,9 +342,9 @@ dependencies = [
342
342
 
343
343
  [[package]]
344
344
  name = "regex-automata"
345
- version = "0.4.14"
345
+ version = "0.4.18"
346
346
  source = "registry+https://github.com/rust-lang/crates.io-index"
347
- checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f"
347
+ checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2"
348
348
  dependencies = [
349
349
  "aho-corasick",
350
350
  "memchr",
@@ -471,9 +471,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
471
471
 
472
472
  [[package]]
473
473
  name = "syn"
474
- version = "3.0.2"
474
+ version = "3.0.4"
475
475
  source = "registry+https://github.com/rust-lang/crates.io-index"
476
- checksum = "a207d6d6a2b7fc470b80443726053f18a2481b7e1eee970597051596567987a3"
476
+ checksum = "e6275cddf4610d1775e6d1fe9469b2e77d0f39fd98fb7450901b821e0c53649f"
477
477
  dependencies = [
478
478
  "proc-macro2",
479
479
  "quote",
@@ -554,9 +554,9 @@ checksum = "7d56353a2a665ad0f41a421187180aab746c8c325620617ad883a99a1cbe66d2"
554
554
 
555
555
  [[package]]
556
556
  name = "tree-sitter"
557
- version = "0.26.12"
557
+ version = "0.26.13"
558
558
  source = "registry+https://github.com/rust-lang/crates.io-index"
559
- checksum = "83c567a8e18ae93f20982c90370b16fd24023aeaf52f6052b96957ab253a0fec"
559
+ checksum = "17ebdd3a5a7e28a1890b876fdbd0c3c0fe0a6336cffaa104f11b9f720c9daa29"
560
560
  dependencies = [
561
561
  "cc",
562
562
  "regex",
@@ -630,12 +630,12 @@ dependencies = [
630
630
 
631
631
  [[package]]
632
632
  name = "winnow"
633
- version = "1.0.3"
633
+ version = "1.0.4"
634
634
  source = "registry+https://github.com/rust-lang/crates.io-index"
635
- checksum = "0592e1c9d151f854e6fd382574c3a0855250e1d9b2f99d9281c6e6391af352f1"
635
+ checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81"
636
636
 
637
637
  [[package]]
638
638
  name = "zmij"
639
- version = "1.0.21"
639
+ version = "1.0.23"
640
640
  source = "registry+https://github.com/rust-lang/crates.io-index"
641
- checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa"
641
+ checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
package/Cargo.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "dart-decimate"
3
- version = "0.0.35"
3
+ version = "0.0.37"
4
4
  edition = "2024"
5
5
  rust-version = "1.85"
6
6
  description = "Rust-native codebase intelligence for Dart and Flutter module graphs."
package/npm/bin/runner.js CHANGED
@@ -4,7 +4,8 @@ const path = require("node:path");
4
4
 
5
5
  function runBinary(binaryName, args) {
6
6
  const root = path.resolve(__dirname, "../..");
7
- const exeName = process.platform === "win32" ? `${binaryName}.exe` : binaryName;
7
+ const exeName =
8
+ process.platform === "win32" ? `${binaryName}.exe` : binaryName;
8
9
  const cachedBinary = path.join(root, "npm", "bin-cache", exeName);
9
10
  const releaseBinary = path.join(root, "target", "release", exeName);
10
11
  const debugBinary = path.join(root, "target", "debug", exeName);
@@ -14,7 +15,12 @@ function runBinary(binaryName, args) {
14
15
  runFirstExisting([cachedBinary, releaseBinary, debugBinary], args);
15
16
 
16
17
  const cargo = process.env.CARGO || "cargo";
17
- run(cargo, ["run", "--release", "--locked", "--bin", binaryName, "--", ...args], root, binaryName);
18
+ run(
19
+ cargo,
20
+ ["run", "--release", "--locked", "--bin", binaryName, "--", ...args],
21
+ root,
22
+ binaryName,
23
+ );
18
24
  }
19
25
 
20
26
  function runFirstExisting(candidates, args) {
@@ -45,7 +51,9 @@ function installCachedBinary(root) {
45
51
 
46
52
  function handleInstallerResult(result) {
47
53
  if (result.error && result.error.code !== "ENOENT") {
48
- console.error(`dart-decimate: install step failed to start: ${result.error.message}`);
54
+ console.error(
55
+ `dart-decimate: install step failed to start: ${result.error.message}`,
56
+ );
49
57
  }
50
58
  forwardSignal(result.signal);
51
59
  }
@@ -7,12 +7,16 @@ const { spawnSync } = require("node:child_process");
7
7
 
8
8
  const root = join(__dirname, "..", "..");
9
9
  const tempDir = mkdtempSync(join(tmpdir(), "dart-decimate-npx-"));
10
+ const npmEnv = {
11
+ ...process.env,
12
+ npm_config_cache: join(tempDir, "npm-cache"),
13
+ };
10
14
 
11
15
  try {
12
16
  const pack = spawnSync(
13
17
  "npm",
14
18
  ["pack", "--json", "--pack-destination", tempDir],
15
- { cwd: root, encoding: "utf8" },
19
+ { cwd: root, encoding: "utf8", env: npmEnv },
16
20
  );
17
21
  if (pack.error) {
18
22
  process.stderr.write(`failed to execute npm: ${pack.error.message}\n`);
@@ -31,7 +35,7 @@ try {
31
35
  ["--yes", "--package", tarball, "--", "dart-decimate", "--help"],
32
36
  {
33
37
  encoding: "utf8",
34
- env: { ...process.env, DART_DECIMATE_SKIP_DOWNLOAD: "1" },
38
+ env: { ...npmEnv, DART_DECIMATE_SKIP_DOWNLOAD: "1" },
35
39
  },
36
40
  );
37
41
  if (result.stdout) {
@@ -1,18 +1,22 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const { mkdtempSync, readFileSync, rmSync } = require("fs");
4
- const { tmpdir } = require("os");
5
- const { join } = require("path");
6
- const { spawnSync } = require("child_process");
3
+ const { mkdtempSync, readFileSync, rmSync } = require("node:fs");
4
+ const { tmpdir } = require("node:os");
5
+ const { join } = require("node:path");
6
+ const { spawnSync } = require("node:child_process");
7
7
 
8
8
  const root = join(__dirname, "..", "..");
9
9
  const tempDir = mkdtempSync(join(tmpdir(), "dart-decimate-npx-mcp-"));
10
+ const npmEnv = {
11
+ ...process.env,
12
+ npm_config_cache: join(tempDir, "npm-cache"),
13
+ };
10
14
 
11
15
  try {
12
16
  const pack = spawnSync(
13
17
  "npm",
14
18
  ["pack", "--json", "--pack-destination", tempDir],
15
- { cwd: root, encoding: "utf8" },
19
+ { cwd: root, encoding: "utf8", env: npmEnv },
16
20
  );
17
21
  if (pack.error) {
18
22
  process.stderr.write(`failed to execute npm: ${pack.error.message}\n`);
@@ -34,7 +38,7 @@ try {
34
38
  {
35
39
  input: initialize,
36
40
  encoding: "utf8",
37
- env: { ...process.env, DART_DECIMATE_SKIP_DOWNLOAD: "1" },
41
+ env: { ...npmEnv, DART_DECIMATE_SKIP_DOWNLOAD: "1" },
38
42
  },
39
43
  );
40
44
  if (result.stdout) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dart-decimate",
3
- "version": "0.0.35",
3
+ "version": "0.0.37",
4
4
  "description": "Rust-native codebase intelligence for Dart and Flutter module graphs.",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -31,9 +31,9 @@
31
31
  "typecheck": "node scripts/typecheck-js.mjs",
32
32
  "version:check": "node scripts/check-version-sync.mjs",
33
33
  "lint": "npm run version:check && npm run migration:check && npm run lint:js && npm run format:check",
34
- "lint:js": "oxlint .",
35
- "format": "prettier --write . && cargo fmt",
36
- "format:check": "prettier --check . && cargo fmt --check",
34
+ "lint:js": "biome lint .",
35
+ "format": "biome format --write . && cargo fmt",
36
+ "format:check": "biome format . && cargo fmt --check",
37
37
  "version:bump:check": "node scripts/check-pr-version-bump.mjs",
38
38
  "release:check": "node scripts/check-release-version.mjs",
39
39
  "migration:check": "node scripts/check-dart-decimate-migration.mjs",
@@ -52,8 +52,6 @@
52
52
  "access": "public"
53
53
  },
54
54
  "devDependencies": {
55
- "fallow": "3.15.0",
56
- "oxlint": "1.78.0",
57
- "prettier": "3.9.6"
55
+ "@biomejs/biome": "2.5.11"
58
56
  }
59
57
  }
@@ -6,8 +6,7 @@ pub(crate) fn package_used_in_tooling(package_root: &Path, dependency: &str) ->
6
6
  || known_tooling_convention(package_root, dependency)
7
7
  || tooling_files(package_root).into_iter().any(|path| {
8
8
  fs::read_to_string(path)
9
- .ok()
10
- .is_some_and(|source| source_mentions_dependency(&source, dependency))
9
+ .is_ok_and(|source| source_mentions_dependency(&source, dependency))
11
10
  })
12
11
  }
13
12
 
@@ -33,7 +32,7 @@ fn contains_runnable_test(dir: &Path) -> bool {
33
32
  };
34
33
  entries.flatten().any(|entry| {
35
34
  let path = entry.path();
36
- entry.file_type().ok().is_some_and(|file_type| {
35
+ entry.file_type().is_ok_and(|file_type| {
37
36
  file_type.is_file() && is_runnable_test_file(&path)
38
37
  || file_type.is_dir() && contains_runnable_test(&path)
39
38
  })
@@ -52,8 +51,7 @@ fn is_runnable_test_file(path: &Path) -> bool {
52
51
  return true;
53
52
  }
54
53
  crate::extract_dart_file(path)
55
- .ok()
56
- .is_some_and(|file| crate::extract::has_top_level_function(&file, "main"))
54
+ .is_ok_and(|file| crate::extract::has_top_level_function(&file, "main"))
57
55
  }
58
56
 
59
57
  fn tooling_files(package_root: &Path) -> Vec<PathBuf> {
@@ -746,9 +746,7 @@ fn parse_numeric_literal(source: &str) -> Option<Rational> {
746
746
  } else {
747
747
  (normalized, 0)
748
748
  };
749
- let (whole, fraction) = mantissa
750
- .split_once('.')
751
- .map_or((mantissa, ""), |parts| parts);
749
+ let (whole, fraction) = mantissa.split_once('.').unwrap_or((mantissa, ""));
752
750
  if fraction.contains('.') || (whole.is_empty() && fraction.is_empty()) {
753
751
  return None;
754
752
  }
@@ -74,9 +74,7 @@ pub(super) fn claude_settings_status(
74
74
  }
75
75
 
76
76
  fn settings_source_has_agent_command(source: &str) -> bool {
77
- serde_json::from_str::<Value>(source)
78
- .ok()
79
- .is_some_and(|value| value_has_agent_command(&value))
77
+ serde_json::from_str::<Value>(source).is_ok_and(|value| value_has_agent_command(&value))
80
78
  }
81
79
 
82
80
  fn value_has_agent_command(value: &Value) -> bool {
@@ -14,8 +14,7 @@ pub(super) fn route_alias_receiver_node(
14
14
  source: &str,
15
15
  ) -> bool {
16
16
  node.utf8_text(source.as_bytes())
17
- .ok()
18
- .is_some_and(|text| route_alias_receiver_text(text, aliases))
17
+ .is_ok_and(|text| route_alias_receiver_text(text, aliases))
19
18
  }
20
19
 
21
20
  pub(super) fn route_alias_receiver_text(text: &str, aliases: &BTreeSet<String>) -> bool {
@@ -1267,8 +1267,7 @@ fn method_name(node: Node<'_>, source: &str) -> Option<String> {
1267
1267
 
1268
1268
  fn method_is_getter(node: Node<'_>, source: &str) -> bool {
1269
1269
  node.utf8_text(source.as_bytes())
1270
- .ok()
1271
- .is_some_and(|text| text.split_whitespace().any(|part| part == "get"))
1270
+ .is_ok_and(|text| text.split_whitespace().any(|part| part == "get"))
1272
1271
  }
1273
1272
 
1274
1273
  fn local_function_name(node: Node<'_>, source: &str) -> Option<String> {
package/src/scan.rs CHANGED
@@ -200,7 +200,7 @@ fn ignored_by_parent_gitignore(root: &Path, scan_root: &Path) -> bool {
200
200
  return false;
201
201
  }
202
202
  }
203
- builder.build().ok().is_some_and(|gitignore| {
203
+ builder.build().is_ok_and(|gitignore| {
204
204
  gitignore
205
205
  .matched_path_or_any_parents(scan_root, true)
206
206
  .is_ignore()
@@ -3865,7 +3865,7 @@ fn debug_or_local_only_http_context(source: &str, index: usize) -> bool {
3865
3865
  .map_or(0, |line| {
3866
3866
  let mut start = line;
3867
3867
  for _ in 0..5 {
3868
- start = source[..start].rfind('\n').map_or(0, |previous| previous);
3868
+ start = source[..start].rfind('\n').unwrap_or(0);
3869
3869
  }
3870
3870
  start
3871
3871
  })
@@ -240,8 +240,7 @@ fn is_named_parameter(param: Node<'_>, source: &str) -> bool {
240
240
  parent.kind() == "optional_formal_parameters"
241
241
  && parent
242
242
  .utf8_text(source.as_bytes())
243
- .ok()
244
- .is_some_and(|text| text.trim_start().starts_with('{'))
243
+ .is_ok_and(|text| text.trim_start().starts_with('{'))
245
244
  }
246
245
 
247
246
  fn formal_parameter_name(param: Node<'_>, source: &str) -> Option<String> {
@@ -141,8 +141,7 @@ fn is_named_parameter(param: Node<'_>, signature: Node<'_>, source: &str) -> boo
141
141
  if node.kind() == "optional_formal_parameters" {
142
142
  return node
143
143
  .utf8_text(source.as_bytes())
144
- .ok()
145
- .is_some_and(|text| text.trim_start().starts_with('{'));
144
+ .is_ok_and(|text| text.trim_start().starts_with('{'));
146
145
  }
147
146
  parent = node.parent();
148
147
  }
@@ -205,8 +205,7 @@ fn is_named_parameter(param: Node<'_>, source: &str) -> bool {
205
205
  parent.kind() == "optional_formal_parameters"
206
206
  && parent
207
207
  .utf8_text(source.as_bytes())
208
- .ok()
209
- .is_some_and(|text| text.trim_start().starts_with('{'))
208
+ .is_ok_and(|text| text.trim_start().starts_with('{'))
210
209
  }
211
210
 
212
211
  fn formal_parameter_name(param: Node<'_>, source: &str) -> Option<String> {
@@ -2324,8 +2323,7 @@ fn named_argument_value(node: Node<'_>) -> Option<Node<'_>> {
2324
2323
  fn argument_matches_roots(argument: Node<'_>, roots: &BTreeSet<String>, source: &str) -> bool {
2325
2324
  argument
2326
2325
  .utf8_text(source.as_bytes())
2327
- .ok()
2328
- .is_some_and(|text| expression_matches_roots(text, roots))
2326
+ .is_ok_and(|text| expression_matches_roots(text, roots))
2329
2327
  }
2330
2328
 
2331
2329
  pub(super) fn pattern_binds_name(node: Node<'_>, name: &str, source: &str) -> bool {