Skip to content

Commit

Permalink
Fix linting & code style (#482)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksongoode authored Jun 18, 2024
1 parent aff2215 commit 913dae1
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 6 deletions.
4 changes: 3 additions & 1 deletion psst-core/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ fn main() {
// And construct the http-style url
remote_url = format!("https://{domain}/{path}");
}
remote_url = remote_url.trim_end_matches(".git").to_owned();
let trimmed_url = remote_url.trim_end_matches(".git");
remote_url.clone_from(&String::from(trimmed_url));

let outfile = format!("{}/remote-url.txt", outdir);
let mut file = fs::File::create(outfile).unwrap();
write!(file, r#""{}""#, remote_url).ok();
Expand Down
1 change: 1 addition & 0 deletions psst-gui/src/data/id.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#[allow(dead_code)]
pub trait Id {
type Id: PartialEq;

Expand Down
1 change: 0 additions & 1 deletion psst-gui/src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use std::time::Duration;

use druid::{
im::Vector,
lens::Unit,
widget::{CrossAxisAlignment, Either, Flex, Label, List, Scroll, Slider, Split, ViewSwitcher},
Color, Env, Insets, Key, LensExt, Menu, MenuItem, Selector, Widget, WidgetExt, WindowDesc,
};
Expand Down
2 changes: 0 additions & 2 deletions psst-gui/src/ui/preferences.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ fn general_tab_widget() -> impl Widget<AppState> {
|usize: &usize| usize.to_string(),
)),
)
.padding((theme::grid(1.5), 0.0))
.lens(AppState::config.then(Config::seek_duration)),
);

Expand All @@ -246,7 +245,6 @@ fn general_tab_widget() -> impl Widget<AppState> {
|usize: &usize| usize.to_string(),
)),
)
.padding((theme::grid(1.5), 0.0))
.lens(AppState::config.then(Config::paginated_limit)),
);

Expand Down
1 change: 1 addition & 0 deletions psst-gui/src/widget/icons.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::ui::theme;
use druid::{kurbo::BezPath, widget::prelude::*, Affine, Color, KeyOrValue, Size};

#[allow(dead_code)]
pub static LOGO: SvgIcon = SvgIcon {
svg_path: "M2.34146 0.685791L28.5825 26.9268L26.9268 28.5825L0.685791 2.34145L2.34146 0.685791Z M22.2439 11.7073V15.2195C22.2441 15.8464 22.1721 16.4712 22.0295 17.0817L23.9012 18.9512C24.3547 17.7594 24.5865 16.4947 24.5854 15.2195V11.7073H22.2439ZM15.2195 29.2683V25.691C16.6827 25.5282 18.0952 25.0587 19.3646 24.3132L17.6342 22.5841C16.3849 23.1891 15.0025 23.4672 13.6165 23.3925C12.2305 23.3178 10.886 22.8926 9.70906 22.1568C8.53207 21.421 7.56101 20.3986 6.88673 19.1853C6.21245 17.9721 5.85701 16.6076 5.85367 15.2195V11.7073H3.51221V15.2195C3.51221 20.6341 7.61708 25.1063 12.8781 25.691V29.2683H8.19513V31.6098H19.9025V29.2683H15.2195ZM19.9025 14.9539V7.02438C19.9025 3.74194 17.3312 1.17072 14.0488 1.17072C13.029 1.16706 12.0261 1.43096 11.1402 1.93606C10.2542 2.44117 9.5163 3.16981 9.00001 4.04926 M8.19513 13.1437V15.1464C8.19618 16.706 8.81282 18.2022 9.91098 19.3098C10.66 20.0884 11.6134 20.6402 12.6617 20.9017C13.71 21.1633 14.8108 21.1241 15.8378 20.7886L8.19513 13.1437Z",
svg_size: Size::new(29.0, 32.0),
Expand Down
1 change: 1 addition & 0 deletions psst-gui/src/widget/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ use crate::{
};

pub trait MyWidgetExt<T: Data>: Widget<T> + Sized + 'static {
#[allow(dead_code)]
fn log(self, label: &'static str) -> Logger<Self> {
Logger::new(self).with_label(label)
}
Expand Down
4 changes: 2 additions & 2 deletions psst-gui/src/widget/remote_image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl<T: Data> Widget<T> for RemoteImage<T> {
if let LifeCycle::WidgetAdded = event {
let location = (self.locator)(data, env);
self.image = None;
self.location = location.clone();
self.location.clone_from(&location);
if let Some(location) = location {
ctx.submit_command(REQUEST_DATA.with(location).to(ctx.widget_id()));
}
Expand All @@ -74,7 +74,7 @@ impl<T: Data> Widget<T> for RemoteImage<T> {
let location = (self.locator)(data, env);
if location != self.location {
self.image = None;
self.location = location.clone();
self.location.clone_from(&location);
if let Some(location) = location {
ctx.submit_command(REQUEST_DATA.with(location).to(ctx.widget_id()));
}
Expand Down

0 comments on commit 913dae1

Please sign in to comment.