diff --git a/src/presence.rs b/src/presence.rs
index 8f3d2cf109a806ab68600cb12caa159412255553..765e680d87d7ef36aab84f85dd178252aa3467ff 100644
--- a/src/presence.rs
+++ b/src/presence.rs
@@ -5,18 +5,14 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+use crate::error::Error;
+use crate::ns;
+use jid::Jid;
+use minidom::{Element, ElementEmitter, IntoAttributeValue, IntoElements};
use std::collections::BTreeMap;
use std::str::FromStr;
use try_from::TryFrom;
-use minidom::{Element, ElementEmitter, IntoAttributeValue, IntoElements};
-
-use jid::Jid;
-
-use crate::error::Error;
-
-use crate::ns;
-
/// Should be implemented on every known payload of a ``.
pub trait PresencePayload: TryFrom + Into {}
diff --git a/src/rsm.rs b/src/rsm.rs
index afa08be66f6361eaee0aa543116c791092bc3c76..0cd048ec854d5c4bb11c16906093356c0498aaff 100644
--- a/src/rsm.rs
+++ b/src/rsm.rs
@@ -4,13 +4,10 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
-use try_from::TryFrom;
-
-use minidom::Element;
-
use crate::error::Error;
-
use crate::ns;
+use minidom::Element;
+use try_from::TryFrom;
/// Requests paging through a potentially big set of items (represented by an
/// UID).
diff --git a/src/sasl.rs b/src/sasl.rs
index 3ae0c7adfd8a076d5d370a63f33c78de3884d8fd..05dd250aba849569c445349720e024dee0e0179a 100644
--- a/src/sasl.rs
+++ b/src/sasl.rs
@@ -4,15 +4,13 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
-use std::collections::BTreeMap;
-
use crate::error::Error;
+use crate::helpers::Base64;
use crate::ns;
use minidom::Element;
+use std::collections::BTreeMap;
use try_from::TryFrom;
-use crate::helpers::Base64;
-
generate_attribute!(
/// The list of available SASL mechanisms.
Mechanism, "mechanism", {
diff --git a/src/stanza_error.rs b/src/stanza_error.rs
index a0848eec439f6cc8e143a3c0ca8d171b5b99a1bf..c5e62026848b668e5d269d0fdeb8c4f1e3a7eeef 100644
--- a/src/stanza_error.rs
+++ b/src/stanza_error.rs
@@ -4,16 +4,14 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
-use std::collections::BTreeMap;
-use try_from::TryFrom;
-
-use minidom::Element;
-
use crate::error::Error;
use crate::message::MessagePayload;
use crate::ns;
use crate::presence::PresencePayload;
use jid::Jid;
+use minidom::Element;
+use std::collections::BTreeMap;
+use try_from::TryFrom;
generate_attribute!(
/// The type of the error.