Skip to content

Commit

Permalink
fixed formatig
Browse files Browse the repository at this point in the history
  • Loading branch information
ge72mum committed Oct 20, 2022
1 parent fb7594e commit ab33340
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
11 changes: 5 additions & 6 deletions src/app/components/details/details_model.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
use gio::prelude::*;
use gdk::prelude::*;
use gio::SimpleActionGroup;
use std::cell::Ref;
use std::ops::Deref;
use std::rc::Rc;
use gdk::prelude::*;

use crate::api::SpotifyApiError;
use crate::app::components::labels;
Expand Down Expand Up @@ -103,10 +102,10 @@ impl DetailsModel {
pub fn toggle_copy_link(&self) {
let album_id = self.id.clone();
let link = format!("https://open.spotify.com/album/{}", &album_id);
let clipboard = gdk::Display::default().unwrap().clipboard();
clipboard
.set_content(Some(&gdk::ContentProvider::for_value(&link.to_value())))
.expect("Failed to set clipboard content");
let clipboard = gdk::Display::default().unwrap().clipboard();
clipboard
.set_content(Some(&gdk::ContentProvider::for_value(&link.to_value())))
.expect("Failed to set clipboard content");
}

pub fn load_more(&self) -> Option<()> {
Expand Down
1 change: 0 additions & 1 deletion src/app/components/playlist_details/playlist_details.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ impl PlaylistDetailsWidget {
{
self.widget().header_widget.connect_copy(f);
}

}

pub struct PlaylistDetails {
Expand Down
12 changes: 5 additions & 7 deletions src/app/components/playlist_details/playlist_details_model.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use gio::prelude::*;
use gdk::prelude::*;
use gio::SimpleActionGroup;
use std::ops::Deref;
use std::rc::Rc;
use gdk::prelude::*;

use crate::api::SpotifyApiError;
use crate::app::components::SimpleHeaderBarModel;
Expand Down Expand Up @@ -97,12 +96,11 @@ impl PlaylistDetailsModel {
pub fn toggle_copy_link(&self) {
let id = self.id.clone();
let link = format!("https://open.spotify.com/playlist/{}", &id);
let clipboard = gdk::Display::default().unwrap().clipboard();
clipboard
.set_content(Some(&gdk::ContentProvider::for_value(&link.to_value())))
.expect("Failed to set clipboard content");
let clipboard = gdk::Display::default().unwrap().clipboard();
clipboard
.set_content(Some(&gdk::ContentProvider::for_value(&link.to_value())))
.expect("Failed to set clipboard content");
}

}

impl PlaylistModel for PlaylistDetailsModel {
Expand Down

0 comments on commit ab33340

Please sign in to comment.