g3189
April 30, 2020, 5:05am
1
ldap3 - version 0.6.1
i get this error while building my project. It used to work properly previouly i hit this error since the latest changes ldap3 crate.
mismatched types
--> /home/xxx/.cargo/registry/src/github.com-1ecc6299db9ec823/ldap3-0.6.1/src/controls_impl/assertion.rs:33:28
write::encode_into(&mut buf, filter).expect("encoded");
| ^^^^^^^^ expected struct bytes::bytes_mut::BytesMut
, found struct bytes::BytesMut
= note: expected type &mut bytes::bytes_mut::BytesMut
found type &mut bytes::BytesMut
Any help is appreciated.
alice
April 30, 2020, 7:15am
2
ldap3 relies on bytes version 0.4.x. What version are you using?
g3189
April 30, 2020, 7:54am
3
I have not specified any version of bytes in my project I only metioned ldap3 = "0.6.1" in my Cargo.toml.
When i check my cargo.lock i see this for lber and ldap
[[package]]
name = "lber"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
"bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
"nom 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "ldap3"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
"bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lber 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"native-tls 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"nom 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-codec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-proto 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-tls 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-uds 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-uds-proto 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
alice
April 30, 2020, 7:55am
4
It seems like you have dependencies on two crates that use different versions of bytes. The error you're seeing is that you can't use a Bytes
from 0.4.x with one from 0.5.x.
g3189
April 30, 2020, 8:10am
5
Ya i got it I was able to figure that but I am having difficulty to resolve this mutliple dependency.
ldap3 - 0.6.1 is depending on lber whose previous version 0.1.6 (which used bytes 0.4.1) but recently the lber is bumped to 0.1.7 (which uses bytes 0.5).
[package]
authors = ["Gregor Reitzenstein <dean4devil@paranoidlabs.org>", "Ivan Nejgebauer <inejge@gmail.com>"]
categories = ["encoding", "parsing"]
description = "An ASN.1/BER parser/encoder based on nom"
keywords = ["ASN1", "BER", "nom"]
license = "MIT"
name = "lber"
repository = "https://github.com/inejge/ldap3"
documentation = "https://docs.rs/ldap3"
version = "0.1.7"
[dependencies]
byteorder = "1"
bytes = "0.5"
nom = "2"
https://github.com/inejge/ldap3/blob/v0.6.1/lber/Cargo.toml
Could you point me where I need to fix
inejge
April 30, 2020, 8:12am
6
Yes, lber
is tripping you up with the different version of bytes
. Try specifying lber = "=0.1.6"
in your Cargo.toml
. I'll try to fix it later.
g3189
April 30, 2020, 8:16am
7
Thanks @inejge it works. Thanks @alice
system
Closed
July 29, 2020, 8:16am
8
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.