Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4f88dfb

Browse files
committedMar 24, 2025
fix(thiserror): Migrate to v2
This require add `thiserror` as direct dependencies of crate that use. Our previous way of providing `thiserror` from a utils crate no longer work CF issue [dtolnay/thiserror#386](dtolnay/thiserror#386). This could be fixed by [rust-lang/rust#54363](rust-lang/rust#54363). To limit further error, `thiserror` is not longer re-exported by `libparsec_types`.
1 parent a223f41 commit 4f88dfb

File tree

12 files changed

+16
-6
lines changed

12 files changed

+16
-6
lines changed
 

‎Cargo.lock

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎libparsec/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ libparsec_testbed = { workspace = true, optional = true }
4040
libparsec_tests_fixtures = { workspace = true, optional = true }
4141

4242
log = { workspace = true }
43+
thiserror = { workspace = true }
4344

4445
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
4546
libparsec_platform_mountpoint = { workspace = true }

‎libparsec/crates/client/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ paste = { workspace = true }
2626
log = { workspace = true }
2727
blahaj = { workspace = true }
2828
smallvec = { workspace = true }
29+
thiserror = { workspace = true }
2930

3031
[dev-dependencies]
3132
libparsec_tests_lite = { workspace = true }

‎libparsec/crates/client/src/device/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Parsec Cloud (https://parsec.cloud) Copyright (c) BUSL-1.1 2016-present Scille SAS
22

3-
use libparsec_types::{anyhow, thiserror, AvailableDevice};
3+
use libparsec_types::{anyhow, AvailableDevice};
44

55
use crate::ClientConfig;
66

‎libparsec/crates/platform_device_loader/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ libparsec_types = { workspace = true }
2525
zeroize = { workspace = true, features = ["alloc"] }
2626
log = { workspace = true }
2727
itertools = { workspace = true }
28+
thiserror = { workspace = true }
2829

2930
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
3031
dirs = { workspace = true }

‎libparsec/crates/platform_ipc/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ libparsec_testbed = { workspace = true, optional = true }
2020
libparsec_platform_async = { workspace = true, optional = true }
2121

2222
log = { workspace = true }
23+
thiserror = { workspace = true }
2324

2425
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
2526
tokio = { workspace = true, features = ["rt"] }

‎libparsec/crates/platform_realm_export/Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ workspace = true
1515
libparsec_types = { workspace = true }
1616
libparsec_platform_async = { workspace = true }
1717

18+
thiserror = { workspace = true }
19+
1820
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
1921
tokio = { workspace = true, features = ["fs", "sync"] }
2022
# We add this dependency to have sqlite3 bundled into our code.

‎libparsec/crates/platform_storage/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ libparsec_testbed = { workspace = true, optional = true }
2424
log = { workspace = true }
2525
paste = { workspace = true }
2626
lazy_static = { workspace = true, optional = true }
27+
thiserror = { workspace = true }
2728

2829
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
2930
tokio = { workspace = true, features = ["fs", "sync"] }

‎libparsec/crates/protocol/src/error.rs

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
use thiserror::Error;
44

5-
use libparsec_types::prelude::*;
6-
75
// TODO: remove me: seems only used in the python bindings
86
#[derive(Error, Debug, Clone, PartialEq, Eq)]
97
pub enum ProtocolError {

‎libparsec/crates/types/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ regex-syntax = { workspace = true, features = ["unicode-perl"] }
4242
unicode-normalization = { workspace = true, features = ["std"] }
4343
paste = { workspace = true }
4444
rand = { workspace = true, features = ["std", "std_rng"] }
45-
thiserror = { workspace = true }
45+
thiserror = { workspace = true, features = ["std"] }
4646
email-address-parser = { workspace = true }
4747
anyhow = { workspace = true, features = ["std", "backtrace"] }
4848
flate2 = { workspace = true }

‎libparsec/crates/types/src/error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub enum DataError {
4242
#[error("Invalid user ID: expected `{expected}`, got `{got}`")]
4343
UnexpectedUserID { expected: UserID, got: UserID },
4444

45-
// `HumanHandle` is 72bytes long, so boxing is needed to limit presure on the stack
45+
// `HumanHandle` is 72bytes long, so boxing is needed to limit pressure on the stack
4646
#[error("Invalid HumanHandle, expected `{expected}`, got `{got}`")]
4747
UnexpectedHumanHandle {
4848
expected: Box<HumanHandle>,

‎libparsec/crates/types/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ extern crate lazy_static;
2626
pub use anyhow;
2727
pub use bytes;
2828
pub use bytes::Bytes;
29-
pub use thiserror;
3029
pub use uuid;
3130

3231
// Re-expose crypto so that `use libparsec_types::prelude::*` is the single-no-brainer-one-liner™

0 commit comments

Comments
 (0)
Failed to load comments.