mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-13 22:52:22 +00:00
clippy appeasement
This commit is contained in:
@@ -116,20 +116,18 @@ impl CompFilterElement {
|
||||
// TODO: Implement prop-filter (and comp-filter?) at some point
|
||||
|
||||
if let Some(time_range) = &self.time_range {
|
||||
if let Some(start) = &time_range.start {
|
||||
if let Some(last_occurence) = cal_object.get_last_occurence().unwrap_or(None) {
|
||||
if start.deref() > &last_occurence.utc() {
|
||||
if let Some(start) = &time_range.start
|
||||
&& let Some(last_occurence) = cal_object.get_last_occurence().unwrap_or(None)
|
||||
&& start.deref() > &last_occurence.utc()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
if let Some(end) = &time_range.end {
|
||||
if let Some(first_occurence) = cal_object.get_first_occurence().unwrap_or(None) {
|
||||
if end.deref() < &first_occurence.utc() {
|
||||
if let Some(end) = &time_range.end
|
||||
&& let Some(first_occurence) = cal_object.get_first_occurence().unwrap_or(None)
|
||||
&& end.deref() < &first_occurence.utc()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
true
|
||||
}
|
||||
@@ -156,8 +154,9 @@ impl From<&FilterElement> for CalendarQuery {
|
||||
for comp_filter in comp_filter_vcalendar.comp_filter.iter() {
|
||||
// A calendar object cannot contain both VEVENT and VTODO, so we only have to handle
|
||||
// whatever we get first
|
||||
if matches!(comp_filter.name.as_str(), "VEVENT" | "VTODO") {
|
||||
if let Some(time_range) = &comp_filter.time_range {
|
||||
if matches!(comp_filter.name.as_str(), "VEVENT" | "VTODO")
|
||||
&& let Some(time_range) = &comp_filter.time_range
|
||||
{
|
||||
let start = time_range.start.as_ref().map(|start| start.date_naive());
|
||||
let end = time_range.end.as_ref().map(|end| end.date_naive());
|
||||
return CalendarQuery {
|
||||
@@ -166,7 +165,6 @@ impl From<&FilterElement> for CalendarQuery {
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Default::default()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,5 +79,5 @@ async fn test_propfind() {
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
let output = response.serialize_to_string().unwrap();
|
||||
let _output = response.serialize_to_string().unwrap();
|
||||
}
|
||||
|
||||
@@ -35,11 +35,9 @@ impl XmlSerialize for TagList {
|
||||
|
||||
if let Some(qname) = &qname {
|
||||
let mut bytes_start = BytesStart::from(qname.to_owned());
|
||||
if !has_prefix {
|
||||
if let Some(ns) = &ns {
|
||||
if !has_prefix && let Some(ns) = &ns {
|
||||
bytes_start.push_attribute((b"xmlns".as_ref(), ns.as_ref()));
|
||||
}
|
||||
}
|
||||
writer.write_event(Event::Start(bytes_start))?;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ use tower::Service;
|
||||
|
||||
#[derive(Clone, RustEmbed, Default)]
|
||||
#[folder = "public/assets"]
|
||||
#[allow(dead_code)] // Since this is not used with the frontend-dev feature
|
||||
pub struct Assets;
|
||||
|
||||
#[derive(Clone, Default)]
|
||||
|
||||
@@ -192,8 +192,8 @@ pub async fn route_get_oidc_callback<US: UserStore + Clone>(
|
||||
.await
|
||||
.map_err(|e| OidcError::UserInfo(e.to_string()))?;
|
||||
|
||||
if let Some(require_group) = &oidc_config.require_group {
|
||||
if !user_info_claims
|
||||
if let Some(require_group) = &oidc_config.require_group
|
||||
&& !user_info_claims
|
||||
.additional_claims()
|
||||
.groups
|
||||
.clone()
|
||||
@@ -206,7 +206,6 @@ pub async fn route_get_oidc_callback<US: UserStore + Clone>(
|
||||
)
|
||||
.into_response());
|
||||
}
|
||||
}
|
||||
|
||||
let user_id = match oidc_config.claim_userid {
|
||||
UserIdClaim::Sub => user_info_claims.subject().to_string(),
|
||||
|
||||
@@ -72,13 +72,12 @@ where
|
||||
let mut inner = self.inner.clone();
|
||||
|
||||
Box::pin(async move {
|
||||
if let Some(session) = request.extensions().get::<Session>() {
|
||||
if let Ok(Some(user_id)) = session.get::<String>("user").await {
|
||||
if let Ok(Some(user)) = ap.get_principal(&user_id).await {
|
||||
if let Some(session) = request.extensions().get::<Session>()
|
||||
&& let Ok(Some(user_id)) = session.get::<String>("user").await
|
||||
&& let Ok(Some(user)) = ap.get_principal(&user_id).await
|
||||
{
|
||||
request.extensions_mut().insert(user);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(auth) = auth_header {
|
||||
let user_id = auth.username();
|
||||
|
||||
@@ -433,14 +433,14 @@ impl AddressbookStore for SqliteAddressbookStore {
|
||||
Self::_delete_addressbook(&mut *tx, principal, addressbook_id, use_trashbin).await?;
|
||||
tx.commit().await.map_err(crate::Error::from)?;
|
||||
|
||||
if let Some(addressbook) = addressbook {
|
||||
if let Err(err) = self.sender.try_send(CollectionOperation {
|
||||
if let Some(addressbook) = addressbook
|
||||
&& let Err(err) = self.sender.try_send(CollectionOperation {
|
||||
data: CollectionOperationInfo::Delete,
|
||||
topic: addressbook.push_topic,
|
||||
}) {
|
||||
})
|
||||
{
|
||||
error!("Push notification about deleted addressbook failed: {err}");
|
||||
};
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -554,14 +554,14 @@ impl CalendarStore for SqliteCalendarStore {
|
||||
Self::_delete_calendar(&mut *tx, principal, id, use_trashbin).await?;
|
||||
tx.commit().await.map_err(crate::Error::from)?;
|
||||
|
||||
if let Some(cal) = cal {
|
||||
if let Err(err) = self.sender.try_send(CollectionOperation {
|
||||
if let Some(cal) = cal
|
||||
&& let Err(err) = self.sender.try_send(CollectionOperation {
|
||||
data: CollectionOperationInfo::Delete,
|
||||
topic: cal.push_topic,
|
||||
}) {
|
||||
})
|
||||
{
|
||||
error!("Push notification about deleted calendar failed: {err}");
|
||||
};
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user