forked from proxmox-mirrors/proxmox
formatting fixup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
ef6ccff5d1
commit
ef5c719150
@ -443,7 +443,9 @@ impl SchemaObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn find_property_by_ident_mut(&mut self, key: &str) -> Option<&mut (FieldName, bool, Schema)> {
|
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)>) {
|
fn extend_properties(&mut self, new_fields: Vec<(FieldName, bool, Schema)>) {
|
||||||
|
@ -178,7 +178,11 @@ pub fn replace_file<P: AsRef<Path>>(
|
|||||||
|
|
||||||
if let Err(err) = std::fs::rename(&tmp_path, &path) {
|
if let Err(err) = std::fs::rename(&tmp_path, &path) {
|
||||||
let _ = unistd::unlink(&tmp_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(())
|
Ok(())
|
||||||
@ -516,8 +520,11 @@ pub fn lock_file<F: AsRawFd>(
|
|||||||
|
|
||||||
/// Open or create a lock file (append mode). Then try to
|
/// Open or create a lock file (append mode). Then try to
|
||||||
/// acquire a lock using `lock_file()`.
|
/// 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 path = path.as_ref();
|
||||||
let mut file = match OpenOptions::new().create(true).append(true).open(path) {
|
let mut file = match OpenOptions::new().create(true).append(true).open(path) {
|
||||||
Ok(file) => file,
|
Ok(file) => file,
|
||||||
|
@ -41,8 +41,7 @@ pub mod epoch_as_rfc3339 {
|
|||||||
{
|
{
|
||||||
use serde::de::Error;
|
use serde::de::Error;
|
||||||
String::deserialize(deserializer).and_then(|string| {
|
String::deserialize(deserializer).and_then(|string| {
|
||||||
crate::tools::time::parse_rfc3339(&string)
|
crate::tools::time::parse_rfc3339(&string).map_err(|err| Error::custom(err.to_string()))
|
||||||
.map_err(|err| Error::custom(err.to_string()))
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user