diff --git a/src/lib/entry.rs b/src/lib/entry.rs index 94c7f6f79..56c51ec35 100644 --- a/src/lib/entry.rs +++ b/src/lib/entry.rs @@ -197,24 +197,20 @@ impl Entry { match self.attrs.get(attr) { Some(values) => { for v in values { - pairs.push( (attr.clone(), v.clone() ) ) + pairs.push((attr.clone(), v.clone())) } } - None => { - return None - } + None => return None, } } // Now make this a filter? - let eq_filters = pairs.into_iter() - .map(|(attr, value)| { - Filter::Eq(attr, value) - }) + let eq_filters = pairs + .into_iter() + .map(|(attr, value)| Filter::Eq(attr, value)) .collect(); - Some(Filter::And(eq_filters)) } diff --git a/src/lib/event.rs b/src/lib/event.rs index 3077ffdc5..b7d6af812 100644 --- a/src/lib/event.rs +++ b/src/lib/event.rs @@ -120,7 +120,7 @@ impl CreateEvent { #[derive(Debug)] pub struct ExistsEvent { pub filter: Filter, - pub internal: bool + pub internal: bool, } impl Message for ExistsEvent { diff --git a/src/lib/server.rs b/src/lib/server.rs index 1889a7d3d..11ff58864 100644 --- a/src/lib/server.rs +++ b/src/lib/server.rs @@ -11,7 +11,7 @@ use be::{ use entry::Entry; use error::OperationError; -use event::{CreateEvent, OpResult, SearchEvent, SearchResult, ExistsEvent}; +use event::{CreateEvent, ExistsEvent, OpResult, SearchEvent, SearchResult}; use filter::Filter; use log::EventLog; use plugins::Plugins; @@ -392,7 +392,11 @@ impl<'a> QueryServerWriteTransaction<'a> { unimplemented!() } - pub fn internal_migrate_or_create(&self, audit: &mut AuditScope, e: Entry) -> Result<(), OperationError> { + pub fn internal_migrate_or_create( + &self, + audit: &mut AuditScope, + e: Entry, + ) -> Result<(), OperationError> { // if the thing exists, ensure the set of attributes on // Entry A match and are present (but don't delete multivalue, or extended // attributes in the situation. @@ -426,7 +430,11 @@ impl<'a> QueryServerWriteTransaction<'a> { } // Should this take a be_txn? - pub fn internal_assert_or_create(&self, audit: &mut AuditScope, e: Entry) -> Result<(), OperationError> { + pub fn internal_assert_or_create( + &self, + audit: &mut AuditScope, + e: Entry, + ) -> Result<(), OperationError> { // If exists, ensure the object is exactly as provided // else, if not exists, create it. IE no extra or excess // attributes and classes. @@ -458,7 +466,11 @@ impl<'a> QueryServerWriteTransaction<'a> { // is the "internal" version, where we define the event as being internal // only, allowing certain plugin by passes etc. - pub fn internal_create(&self, audit: &mut AuditScope, entries: Vec) -> Result<(), OperationError> { + pub fn internal_create( + &self, + audit: &mut AuditScope, + entries: Vec, + ) -> Result<(), OperationError> { // Start the audit scope let mut audit_int = AuditScope::new("internal_create"); // Create the CreateEvent