https://pantsbuild.org/ logo
#development
Title
# development
h

hundreds-father-404

02/17/2021, 9:34 PM
It looks like
tokio-rustls
is exporting
rustls::ClientConfig
as
tokio_rustls::rustls::ClientConfig
. But they're being treated as distinct types I'm trying to use the crate
rustls_native_certs
, which creates a
rustls::RootCertStore
, then trying to set our
tokio_rustls::rustls::ClientConfig
to use it. But it's complaining that we need a
tokio_rustls::rustls::RootCertStore
, not
rustls::RootCertStore
Any idea how to get this re-export playing nicely?
I tried using
.into()
to no avail
h

hundreds-breakfast-49010

02/17/2021, 9:37 PM
it might be the case that the version of
rustls
tookio_rustls
is using internally is not the same as the version pants is using, which would make them different types
šŸ‘ 1
I wonder if we could manually convert from one type to another
h

hundreds-father-404

02/17/2021, 9:38 PM
So, play with versions in Cargo.toml? I have this now
Copy code
rustls = "0.19"
rustls-native-certs = "0.5"
tokio = { version = "0.2.23", features = ["process", "rt-threaded", "sync", "tcp", "time"] }
tokio-rustls = "0.14"
h

hundreds-breakfast-49010

02/17/2021, 9:38 PM
they're probably substantially the same, so if the visiblity rules allow it maybe we could manually construct a version of the type we're actually using from the version tokio_rustls is using
a

average-vr-56795

02/17/2021, 9:41 PM
Yeah,
cargo tree
will help you explore what's going on šŸ™‚
šŸ‘ 1
Almost certainly your easiest path forwards is to change your version of one of the libraries to match what the other expects
šŸ‘ 1
h

hundreds-father-404

02/17/2021, 9:53 PM
Hm still getting the error with the versions being the same.
Copy code
āÆ ./cargo tree | grep rustls
ā”‚   ā”‚   ā”‚       ā”œā”€ā”€ rustls-native-certs v0.4.0
ā”‚   ā”‚   ā”‚       ā”‚   ā”œā”€ā”€ rustls v0.18.1
ā”‚   ā”‚   ā”‚       ā”œā”€ā”€ tokio-rustls v0.14.1
ā”‚   ā”‚   ā”‚       ā”‚   ā”œā”€ā”€ rustls v0.18.1 (*)
COnfirmed that all deps are using
rustls 0.18.1
across the board too
Oh wait nvm, it just worked! Yay
šŸ‘ 1
a

average-vr-56795

02/17/2021, 9:54 PM
šŸ˜„