remove redundant clones
This commit is contained in:
parent
e9af664888
commit
b472a155fc
7 changed files with 13 additions and 15 deletions
|
|
@ -551,7 +551,7 @@ impl cosmic::Application for CosmicAppList {
|
||||||
},
|
},
|
||||||
window::Id(0),
|
window::Id(0),
|
||||||
Some(DndIcon::Custom(icon_id)),
|
Some(DndIcon::Custom(icon_id)),
|
||||||
Box::new(toplevel_group.clone()),
|
Box::new(toplevel_group),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -685,7 +685,7 @@ impl cosmic::Application for Audio {
|
||||||
if artists.len() > 15 {
|
if artists.len() > 15 {
|
||||||
format!("{artists:15}...")
|
format!("{artists:15}...")
|
||||||
} else {
|
} else {
|
||||||
artists.to_string()
|
artists
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
String::new()
|
String::new()
|
||||||
|
|
|
||||||
|
|
@ -27,12 +27,10 @@ pub struct PlayerStatus {
|
||||||
impl PlayerStatus {
|
impl PlayerStatus {
|
||||||
async fn new(player: Player) -> Self {
|
async fn new(player: Player) -> Self {
|
||||||
let metadata = player.metadata().await.unwrap();
|
let metadata = player.metadata().await.unwrap();
|
||||||
let title = metadata.title().map(|t| Cow::from(t.to_string()));
|
let title = metadata.title().map(|t| Cow::from(t));
|
||||||
let artists = metadata.artists().map(|a| {
|
let artists = metadata
|
||||||
a.into_iter()
|
.artists()
|
||||||
.map(|a| Cow::from(a.to_string()))
|
.map(|a| a.into_iter().map(|a| Cow::from(a)).collect::<Vec<_>>());
|
||||||
.collect::<Vec<_>>()
|
|
||||||
});
|
|
||||||
let icon = metadata
|
let icon = metadata
|
||||||
.art_url()
|
.art_url()
|
||||||
.and_then(|u| url::Url::parse(&u).ok())
|
.and_then(|u| url::Url::parse(&u).ok())
|
||||||
|
|
|
||||||
|
|
@ -346,10 +346,10 @@ impl cosmic::Application for CosmicNetworkApplet {
|
||||||
{
|
{
|
||||||
let _ = tx.unbounded_send(NetworkManagerRequest::Password(
|
let _ = tx.unbounded_send(NetworkManagerRequest::Password(
|
||||||
access_point.ssid.clone(),
|
access_point.ssid.clone(),
|
||||||
password.to_string(),
|
password,
|
||||||
));
|
));
|
||||||
self.new_connection
|
self.new_connection
|
||||||
.replace(NewConnectionState::Waiting(access_point.clone()));
|
.replace(NewConnectionState::Waiting(access_point));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
Message::ActivateKnownWifi(ssid) => {
|
Message::ActivateKnownWifi(ssid) => {
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,9 @@ pub fn active_conns_subscription<I: 'static + Hash + Copy + Send + Sync + Debug>
|
||||||
id: I,
|
id: I,
|
||||||
conn: Connection,
|
conn: Connection,
|
||||||
) -> iced::Subscription<NetworkManagerEvent> {
|
) -> iced::Subscription<NetworkManagerEvent> {
|
||||||
let initial = State::Continue(conn.clone());
|
let initial = State::Continue(conn);
|
||||||
subscription::channel(id, 50, move |mut output| {
|
subscription::channel(id, 50, move |mut output| {
|
||||||
let mut state = initial.clone();
|
let mut state = initial;
|
||||||
|
|
||||||
async move {
|
async move {
|
||||||
loop {
|
loop {
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ pub fn devices_subscription<I: 'static + Hash + Copy + Send + Sync + Debug>(
|
||||||
has_popup: bool,
|
has_popup: bool,
|
||||||
conn: Connection,
|
conn: Connection,
|
||||||
) -> iced::Subscription<NetworkManagerEvent> {
|
) -> iced::Subscription<NetworkManagerEvent> {
|
||||||
let initial = State::Continue(conn.clone());
|
let initial = State::Continue(conn);
|
||||||
subscription::channel((id, has_popup), 50, move |mut output| {
|
subscription::channel((id, has_popup), 50, move |mut output| {
|
||||||
let mut state = initial.clone();
|
let mut state = initial.clone();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,9 @@ pub fn wireless_enabled_subscription<I: 'static + Hash + Copy + Send + Sync + De
|
||||||
id: I,
|
id: I,
|
||||||
conn: Connection,
|
conn: Connection,
|
||||||
) -> iced::Subscription<NetworkManagerEvent> {
|
) -> iced::Subscription<NetworkManagerEvent> {
|
||||||
let initial = State::Continue(conn.clone());
|
let initial = State::Continue(conn);
|
||||||
subscription::channel(id, 50, move |mut output| {
|
subscription::channel(id, 50, move |mut output| {
|
||||||
let mut state = initial.clone();
|
let mut state = initial;
|
||||||
|
|
||||||
async move {
|
async move {
|
||||||
loop {
|
loop {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue