Skip to content

Commit c679511

Browse files
committed
style: fix cargo fmt formatting
1 parent ba05e39 commit c679511

4 files changed

Lines changed: 27 additions & 10 deletions

File tree

‎src/app/components/playback_info_panel.rs‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ impl PlaybackInfoPanel {
5454
// Description preview (first 30 chars)
5555
if let Some(desc) = playlist.description() {
5656
let preview = if desc.chars().count() > DESCRIPTION_PREVIEW_LENGTH {
57-
format!("{}...", desc.chars().take(DESCRIPTION_PREVIEW_LENGTH).collect::<String>())
57+
format!(
58+
"{}...",
59+
desc.chars()
60+
.take(DESCRIPTION_PREVIEW_LENGTH)
61+
.collect::<String>()
62+
)
5863
} else {
5964
desc.to_string()
6065
};

‎src/app/db.rs‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,7 @@ impl Database {
8686

8787
// Add new columns only if they don't exist
8888
if !existing_columns.contains(&"description".to_string()) {
89-
connection.execute(
90-
"ALTER TABLE playlists ADD COLUMN description TEXT",
91-
[],
92-
)?;
89+
connection.execute("ALTER TABLE playlists ADD COLUMN description TEXT", [])?;
9390
}
9491

9592
if !existing_columns.contains(&"created_at".to_string()) {

‎src/lib/audio/state_machine.rs‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,13 @@ impl State for StoppedState {
110110

111111
ctx.engine.audio_output = None;
112112

113-
loader::load_file(current_track_path, &mut ctx.engine, &mut ctx.decoder, 0, &ctx.ui_tx);
113+
loader::load_file(
114+
current_track_path,
115+
&mut ctx.engine,
116+
&mut ctx.decoder,
117+
0,
118+
&ctx.ui_tx,
119+
);
114120

115121
ctx.ui_tx
116122
.send(AudioEvent::CurrentTimestamp(0))

‎src/lib/playlist.rs‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ impl Playlist {
298298

299299
// Get the playlist info
300300
let mut stmt = conn_guard.prepare(
301-
"SELECT id, name, description, created_at, updated_at FROM playlists WHERE id = ?1"
301+
"SELECT id, name, description, created_at, updated_at FROM playlists WHERE id = ?1",
302302
)?;
303303

304304
let mut playlist_rows = stmt.query(rusqlite::params![playlist_id])?;
@@ -591,7 +591,10 @@ mod tests {
591591

592592
playlist.set_description(Some("My favorite songs".to_string()));
593593

594-
assert_eq!(playlist.description(), Some("My favorite songs".to_string()));
594+
assert_eq!(
595+
playlist.description(),
596+
Some("My favorite songs".to_string())
597+
);
595598
assert!(playlist.updated_at() > initial_updated_at);
596599
}
597600

@@ -637,8 +640,14 @@ mod tests {
637640
#[test]
638641
fn test_reorder_updates_timestamp() {
639642
let mut playlist = Playlist::new();
640-
playlist.add(LibraryItem::new(PathBuf::from(r"C:\music\song1.mp3"), LibraryPathId::new(0)));
641-
playlist.add(LibraryItem::new(PathBuf::from(r"C:\music\song2.mp3"), LibraryPathId::new(1)));
643+
playlist.add(LibraryItem::new(
644+
PathBuf::from(r"C:\music\song1.mp3"),
645+
LibraryPathId::new(0),
646+
));
647+
playlist.add(LibraryItem::new(
648+
PathBuf::from(r"C:\music\song2.mp3"),
649+
LibraryPathId::new(1),
650+
));
642651

643652
let initial_updated_at = playlist.updated_at();
644653
std::thread::sleep(std::time::Duration::from_millis(10));

0 commit comments

Comments
 (0)