chore: fix compiler warnings

This commit is contained in:
Alexander Bachmann 2025-05-26 22:56:09 +02:00 committed by GitHub
parent d111f3ba80
commit 2a7d07c966
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 19 additions and 19 deletions

View file

@ -43,9 +43,7 @@ use cosmic::{
use cosmic_panel_config::CosmicPanelConfig;
use cosmic_settings_page::{self as page, section};
#[cfg(feature = "page-accessibility")]
use cosmic_settings_subscriptions::accessibility::{
DBusRequest, DBusUpdate, subscription as a11y_subscription,
};
use cosmic_settings_subscriptions::accessibility::subscription as a11y_subscription;
#[cfg(feature = "wayland")]
use desktop::{
dock,

View file

@ -13,7 +13,7 @@ use cosmic_settings_page::{
self as page, Insert,
section::{self, Section},
};
use cosmic_settings_subscriptions::accessibility::{self, DBusRequest, DBusUpdate};
use cosmic_settings_subscriptions::accessibility::{DBusRequest, DBusUpdate};
use cosmic_settings_subscriptions::cosmic_a11y_manager;
use num_traits::FromPrimitive;
use slotmap::SlotMap;

View file

@ -6,7 +6,6 @@ use cosmic_bg_config::Source;
use cosmic_settings_wallpaper as wallpaper;
use std::collections::VecDeque;
use std::env;
use std::io::Read;
use std::path::{Path, PathBuf};
const NAME: &str = "com.system76.CosmicSettings.Wallpaper";

View file

@ -291,7 +291,11 @@ impl Page {
}
}
network_manager::Request::SelectAccessPoint(ssid, hw_address, network_type) => {
network_manager::Request::SelectAccessPoint(
ssid,
_hw_address,
_network_type,
) => {
self.connecting.remove(ssid.as_ref());
}

View file

@ -362,7 +362,7 @@ impl Page {
}
let mut command = None;
if let Some(&node_id) = self.sink_ids.get(self.active_sink.unwrap_or(0)) {
if !self.sink_ids.get(self.active_sink.unwrap_or(0)).is_none() {
command = Some(cosmic::task::future(async move {
tokio::time::sleep(Duration::from_millis(64)).await;
crate::pages::Message::Sound(Message::SinkBalanceApply)

View file

@ -1,13 +1,12 @@
use std::any::TypeId;
use ashpd::desktop::location::{Location, LocationProxy};
use chrono::Datelike;
use cosmic::iced::{
Subscription,
futures::{SinkExt, StreamExt, channel::mpsc::Sender, future},
stream,
};
use sunrise::sunrise_sunset;
use sunrise::{Coordinates, SolarDay, SolarEvent};
use tokio::select;
pub fn daytime() -> cosmic::iced::Subscription<bool> {
@ -45,11 +44,16 @@ async fn inner(mut tx: Sender<bool>) -> anyhow::Result<()> {
let Some(loc) = loc.as_ref() else {
break;
};
let (lat, long) = (loc.latitude(), loc.longitude());
let coord = Coordinates::new(loc.latitude(), loc.longitude()).unwrap();
let now = chrono::Local::now();
let date = now.date_naive();
let (sunrise, sunset) = sunrise_sunset(lat, long, date.year(), date.month0(), date.day0());
let now_in_seconds = now.timestamp();
let current_solar_day = SolarDay::new(coord, date);
let sunrise = current_solar_day
.event_time(SolarEvent::Sunrise)
.timestamp();
let sunset = current_solar_day.event_time(SolarEvent::Sunset).timestamp();
let daytime = now_in_seconds >= sunrise && now_in_seconds <= sunset;
tx.send(daytime).await?;
@ -59,14 +63,9 @@ async fn inner(mut tx: Sender<bool>) -> anyhow::Result<()> {
sunrise - now_in_seconds
} else {
let tmrw = now + chrono::Duration::days(1);
let tmrw_date = tmrw.date_naive();
let (tmrw_sunrise, _) = sunrise_sunset(
lat,
long,
tmrw_date.year(),
tmrw_date.month0(),
tmrw_date.day0(),
);
let tmrw_sunrise = SolarDay::new(coord, tmrw.date_naive())
.event_time(SolarEvent::Sunrise)
.timestamp();
tmrw_sunrise - now_in_seconds
};
next = select! {