formatting fixup

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2020-10-02 09:59:52 +02:00
parent ef6ccff5d1
commit ef5c719150
3 changed files with 14 additions and 6 deletions

View File

@ -443,7 +443,9 @@ impl SchemaObject {
}
fn find_property_by_ident_mut(&mut self, key: &str) -> Option<&mut (FieldName, bool, Schema)> {
self.properties_.iter_mut().find(|p| p.0.as_ident_str() == key)
self.properties_
.iter_mut()
.find(|p| p.0.as_ident_str() == key)
}
fn extend_properties(&mut self, new_fields: Vec<(FieldName, bool, Schema)>) {

View File

@ -178,7 +178,11 @@ pub fn replace_file<P: AsRef<Path>>(
if let Err(err) = std::fs::rename(&tmp_path, &path) {
let _ = unistd::unlink(&tmp_path);
bail!("Atomic rename failed for file {:?} - {}", path.as_ref(), err);
bail!(
"Atomic rename failed for file {:?} - {}",
path.as_ref(),
err
);
}
Ok(())
@ -516,8 +520,11 @@ pub fn lock_file<F: AsRawFd>(
/// Open or create a lock file (append mode). Then try to
/// acquire a lock using `lock_file()`.
pub fn open_file_locked<P: AsRef<Path>>(path: P, timeout: Duration, exclusive: bool) -> Result<File, Error> {
pub fn open_file_locked<P: AsRef<Path>>(
path: P,
timeout: Duration,
exclusive: bool,
) -> Result<File, Error> {
let path = path.as_ref();
let mut file = match OpenOptions::new().create(true).append(true).open(path) {
Ok(file) => file,

View File

@ -41,8 +41,7 @@ pub mod epoch_as_rfc3339 {
{
use serde::de::Error;
String::deserialize(deserializer).and_then(|string| {
crate::tools::time::parse_rfc3339(&string)
.map_err(|err| Error::custom(err.to_string()))
crate::tools::time::parse_rfc3339(&string).map_err(|err| Error::custom(err.to_string()))
})
}
}