mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
fix clippy warnings
This commit is contained in:
parent
7b35121374
commit
41625f8b11
5 changed files with 13 additions and 34 deletions
|
@ -317,7 +317,7 @@ impl<'a> From<String> for RustString<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> From<&str> for RustString<'static> {
|
||||
impl From<&str> for RustString<'static> {
|
||||
fn from(string: &str) -> RustString<'static> {
|
||||
RustString::String(string.to_string())
|
||||
}
|
||||
|
|
|
@ -276,13 +276,11 @@ where
|
|||
let mut vec = unsafe { CL::take_val_from_arg(list, CL::null_value()) };
|
||||
|
||||
// first, drop each of the elements in turn
|
||||
for e in vec.drain(..) {
|
||||
if let Some(e) = e {
|
||||
// SAFETY:
|
||||
// - e is a valid Element (promised by caller)
|
||||
// - e is owned
|
||||
drop(unsafe { PassByPointer::take_from_ptr_arg(e.as_ptr()) });
|
||||
}
|
||||
for e in vec.drain(..).flatten() {
|
||||
// SAFETY:
|
||||
// - e is a valid Element (promised by caller)
|
||||
// - e is owned
|
||||
drop(unsafe { PassByPointer::take_from_ptr_arg(e.as_ptr()) });
|
||||
}
|
||||
// then drop the vector
|
||||
drop(vec);
|
||||
|
|
|
@ -271,7 +271,7 @@ mod test {
|
|||
|
||||
let unsealed = Unsealed {
|
||||
version_id,
|
||||
payload: payload,
|
||||
payload,
|
||||
};
|
||||
let sealed = cryptor.seal(unsealed).unwrap();
|
||||
|
||||
|
@ -291,7 +291,7 @@ mod test {
|
|||
|
||||
let unsealed = Unsealed {
|
||||
version_id,
|
||||
payload: payload,
|
||||
payload,
|
||||
};
|
||||
let mut sealed = cryptor.seal(unsealed).unwrap();
|
||||
sealed.version_id = Uuid::new_v4(); // change the version_id
|
||||
|
@ -309,7 +309,7 @@ mod test {
|
|||
|
||||
let unsealed = Unsealed {
|
||||
version_id,
|
||||
payload: payload,
|
||||
payload,
|
||||
};
|
||||
let sealed = cryptor.seal(unsealed).unwrap();
|
||||
|
||||
|
|
|
@ -173,10 +173,7 @@ impl TaskDb {
|
|||
#[cfg(test)]
|
||||
pub(crate) fn operations(&mut self) -> Vec<ReplicaOp> {
|
||||
let mut txn = self.storage.txn().unwrap();
|
||||
txn.operations()
|
||||
.unwrap()
|
||||
.iter().cloned()
|
||||
.collect()
|
||||
txn.operations().unwrap().to_vec()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -119,12 +119,7 @@ mod test {
|
|||
|
||||
assert_eq!(
|
||||
db.working_set()?,
|
||||
vec![
|
||||
None,
|
||||
Some(uuids[1]),
|
||||
Some(uuids[3]),
|
||||
Some(uuids[4])
|
||||
]
|
||||
vec![None, Some(uuids[1]), Some(uuids[3]), Some(uuids[4])]
|
||||
);
|
||||
|
||||
rebuild(
|
||||
|
@ -142,22 +137,11 @@ mod test {
|
|||
let exp = if renumber {
|
||||
// uuids[1] and uuids[4] are already in the working set, so are compressed
|
||||
// to the top, and then uuids[0] is added.
|
||||
vec![
|
||||
None,
|
||||
Some(uuids[1]),
|
||||
Some(uuids[4]),
|
||||
Some(uuids[0]),
|
||||
]
|
||||
vec![None, Some(uuids[1]), Some(uuids[4]), Some(uuids[0])]
|
||||
} else {
|
||||
// uuids[1] and uuids[4] are already in the working set, at indexes 1 and 3,
|
||||
// and then uuids[0] is added.
|
||||
vec![
|
||||
None,
|
||||
Some(uuids[1]),
|
||||
None,
|
||||
Some(uuids[4]),
|
||||
Some(uuids[0]),
|
||||
]
|
||||
vec![None, Some(uuids[1]), None, Some(uuids[4]), Some(uuids[0])]
|
||||
};
|
||||
|
||||
assert_eq!(db.working_set()?, exp);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue