Skip to content

Commit d3026b3

Browse files
authored
Turbopack: chore: Update anyhow, remove old backtrace feature (#85844)
- `anyhow` now causes `cargo clippy` to warn about `.to_string()` in `bail!(...)` calls. I also inlined most of these format string variables while I was at it. dtolnay/anyhow#426 - The `backtrace` feature isn't needed (and is a no-op) since Rust 1.65. https://github.com/dtolnay/anyhow/blob/master/Cargo.toml#L19-L22
1 parent f43f339 commit d3026b3

File tree

15 files changed

+19
-49
lines changed

15 files changed

+19
-49
lines changed

Cargo.lock

Lines changed: 2 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ tungstenite = "0.20.1"
371371
allsorts = { version = "0.14.0", default-features = false, features = [
372372
"flate2_rust",
373373
] }
374-
anyhow = "1.0.98"
374+
anyhow = "1.0.100"
375375
async-compression = { version = "0.3.13", default-features = false, features = [
376376
"gzip",
377377
"tokio",

crates/next-api/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ bench = false
1313
workspace = true
1414

1515
[dependencies]
16-
anyhow = { workspace = true, features = ["backtrace"] }
16+
anyhow = { workspace = true }
1717
byteorder = { workspace = true }
1818
either = { workspace = true }
1919
futures = { workspace = true }

turbopack/crates/turbo-tasks-fs/src/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1533,10 +1533,8 @@ pub async fn rebase(
15331533
let base_path = [&old_base.path, "/"].concat();
15341534
if !fs_path.path.starts_with(&base_path) {
15351535
bail!(
1536-
"rebasing {} from {} onto {} doesn't work because it's not part of the source path",
1537-
fs_path.to_string(),
1538-
old_base.to_string(),
1539-
new_base.to_string()
1536+
"rebasing {fs_path} from {old_base} onto {new_base} doesn't work because it's not \
1537+
part of the source path",
15401538
);
15411539
}
15421540
if new_base.path.is_empty() {

turbopack/crates/turbo-tasks-fs/src/read_glob.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ async fn resolve_symlink_safely(entry: DirectoryEntry) -> Result<DirectoryEntry>
124124
if source_path.is_inside_or_equal(&resolved_entry.clone().path().unwrap()) {
125125
bail!(
126126
"'{}' is a symlink causes that causes an infinite loop!",
127-
source_path.path.to_string()
127+
source_path.path,
128128
)
129129
}
130130
}

turbopack/crates/turbopack-bench/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ harness = false
1717
workspace = true
1818

1919
[dependencies]
20-
anyhow = { workspace = true, features = ["backtrace"] }
20+
anyhow = { workspace = true }
2121
chromiumoxide = { workspace = true, features = [
2222
"tokio-runtime",
2323
], default-features = false }

turbopack/crates/turbopack-browser/src/ecmascript/content.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,7 @@ impl EcmascriptBrowserChunkContent {
8484
let chunk_server_path = if let Some(path) = output_root.get_path_to(&chunk_path) {
8585
path
8686
} else {
87-
bail!(
88-
"chunk path {} is not in output root {}",
89-
chunk_path.to_string(),
90-
output_root.to_string()
91-
);
87+
bail!("chunk path {chunk_path} is not in output root {output_root}");
9288
};
9389
Either::Left(StringifyJs(chunk_server_path))
9490
}

turbopack/crates/turbopack-browser/src/ecmascript/evaluate/chunk.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,7 @@ impl EcmascriptBrowserEvaluateChunk {
9999
let chunk_server_path = if let Some(path) = output_root.get_path_to(&chunk_path) {
100100
path
101101
} else {
102-
bail!(
103-
"chunk path {} is not in output root {}",
104-
chunk_path.to_string(),
105-
output_root.to_string()
106-
);
102+
bail!("chunk path {chunk_path} is not in output root {output_root}");
107103
};
108104
Either::Left(StringifyJs(chunk_server_path))
109105
}

turbopack/crates/turbopack-browser/src/ecmascript/version.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,7 @@ impl EcmascriptBrowserChunkVersion {
2727
let chunk_path = if let Some(path) = output_root.get_path_to(&chunk_path) {
2828
path
2929
} else {
30-
bail!(
31-
"chunk path {} is not in client root {}",
32-
chunk_path.to_string(),
33-
output_root.to_string()
34-
);
30+
bail!("chunk path {chunk_path} is not in client root {output_root}");
3531
};
3632
let entries = EcmascriptBrowserChunkContentEntries::new(content).await?;
3733
let mut entries_hashes =

turbopack/crates/turbopack-cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ custom_allocator = ["turbo-tasks-malloc/custom_allocator"]
3737
workspace = true
3838

3939
[dependencies]
40-
anyhow = { workspace = true, features = ["backtrace"] }
40+
anyhow = { workspace = true }
4141
clap = { workspace = true, features = ["derive", "env"] }
4242
console-subscriber = { workspace = true, optional = true }
4343
dunce = { workspace = true }

0 commit comments

Comments
 (0)