mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 17:36:29 +03:00
clippy
This commit is contained in:
10
src/tools.rs
10
src/tools.rs
@@ -670,16 +670,6 @@ pub(crate) fn parse_receive_headers(headers: &Headers) -> String {
|
|||||||
.join("\n")
|
.join("\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn single_value<T>(collection: impl IntoIterator<Item = T>) -> Option<T> {
|
|
||||||
let mut iter = collection.into_iter();
|
|
||||||
if let Some(value) = iter.next() {
|
|
||||||
if iter.next().is_none() {
|
|
||||||
return Some(value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
None
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
#![allow(clippy::indexing_slicing)]
|
#![allow(clippy::indexing_slicing)]
|
||||||
|
|||||||
Reference in New Issue
Block a user