Skip to content

Commit 3591f2d

Browse files
committed
(docker-based-examples) cargo fix, cleanup
1 parent bc2c212 commit 3591f2d

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

src/errors.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
//! Errors and trait implementations.
22
//!
3-
use std::fmt;
4-
use std::error;
53
use std::convert;
6-
4+
use std::error;
5+
use std::fmt;
76

87
/// A LDAP error.
98
///
@@ -40,7 +39,7 @@ impl error::Error for LDAPError {
4039
///
4140
/// Note, currently this method always return `None` as we do not know the root cause of the
4241
/// error.
43-
fn cause(&self) -> Option<&error::Error> {
42+
fn cause(&self) -> Option<&dyn error::Error> {
4443
None
4544
}
4645
}

src/lib.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@
66
extern crate libc;
77
use errors::LDAPError;
88
use libc::{c_char, c_int, c_void, timeval};
9+
use std::boxed;
910
use std::collections::HashMap;
1011
use std::ffi::{CStr, CString};
11-
use std::iter::{FlatMap, FromIterator};
1212
use std::ptr;
13-
use std::ptr::null_mut;
1413
use std::slice;
15-
use std::{ascii, boxed};
1614

1715
pub mod codes;
1816
pub mod errors;
@@ -531,7 +529,7 @@ pub fn escape_filter_assertion_value(input: &str) -> Result<String, LDAPError> {
531529
})
532530
.collect(),
533531
)
534-
.map_err(|e| LDAPError::NativeError("Error while escaping filter argument".into()))
532+
.map_err(|_e| LDAPError::NativeError("Error while escaping filter argument".into()))
535533
}
536534

537535
#[cfg(test)]
@@ -590,7 +588,7 @@ mod tests {
590588
let ldap = super::RustLDAP::new(TEST_ADDRESS).unwrap();
591589

592590
assert!(ldap.set_option(codes::options::LDAP_OPT_PROTOCOL_VERSION, &3));
593-
ldap.start_tls(None, None);
591+
ldap.start_tls(None, None).unwrap();
594592

595593
ldap.set_option(
596594
codes::options::LDAP_OPT_PROTOCOL_VERSION,

0 commit comments

Comments
 (0)