Compare commits

...

2 Commits

Author SHA1 Message Date
871aeb8436 Update beets to 2.0.0 in CI (#182)
All checks were successful
Cargo CI / Build and Test (push) Successful in 1m57s
Cargo CI / Lint (push) Successful in 1m3s
Cargo CI / Build and Test (pull_request) Successful in 1m53s
Cargo CI / Lint (pull_request) Successful in 1m6s
Closes #181

Reviewed-on: #182
2024-08-24 15:43:48 +02:00
8ff09e66ba Update rust toolchain to 1.80 (#180)
All checks were successful
Cargo CI / Build and Test (push) Successful in 1m55s
Cargo CI / Lint (push) Successful in 1m5s
Closes #179

Reviewed-on: #180
2024-08-24 15:10:54 +02:00
9 changed files with 17 additions and 21 deletions

View File

@ -1,4 +1,4 @@
FROM docker.io/library/rust:1.79
FROM docker.io/library/rust:1.80
RUN rustup component add \
clippy \
@ -9,5 +9,10 @@ RUN cargo install \
grcov
RUN apt-get update && apt-get install -y \
beets \
nodejs
nodejs \
pipx
# Once pipx>=1.5.0 is available use --global instead of env
RUN env PIPX_HOME=/usr/local/pipx \
PIPX_BIN_DIR=/usr/local/bin \
pipx install --include-deps --system-site-packages beets==2.0.0

View File

@ -13,7 +13,7 @@ env:
jobs:
build_and_test:
name: Build and Test
container: docker.io/drrobot/musichoard-ci:rust-1.79
container: docker.io/drrobot/musichoard-ci:20240824-1
env:
BEETSDIR: ./
LLVM_PROFILE_FILE: target/debug/profraw/musichoard-%p-%m.profraw
@ -48,7 +48,7 @@ jobs:
lint:
name: Lint
container: docker.io/drrobot/musichoard-ci:rust-1.75
container: docker.io/drrobot/musichoard-ci:20240824-1
steps:
- uses: actions/checkout@v3
- run: cargo clippy --no-default-features --all-targets -- -D warnings

View File

@ -1,5 +1,6 @@
fn main() {
println!("cargo::rustc-check-cfg=cfg(nightly)");
if let Some(true) = version_check::is_feature_flaggable() {
println!("cargo:rustc-cfg=nightly");
println!("cargo::rustc-cfg=nightly");
}
}

View File

@ -159,11 +159,7 @@ impl<BLE: IBeetsLibraryExecutor> BeetsLibrary<BLE> {
let album_title = split[5].to_string();
let track_number = split[6].parse::<u32>()?;
let track_title = split[7].to_string();
let track_artist = split[8]
.to_string()
.split("; ")
.map(|s| s.to_owned())
.collect();
let track_artist = split[8].split("; ").map(|s| s.to_owned()).collect();
let track_format = match str_to_format(split[9].to_string().as_str()) {
Some(format) => format,
None => return Err(Error::Invalid(line.to_string())),

View File

@ -1,4 +1,4 @@
use crossterm::event::{KeyEvent, MouseEvent};
use crossterm::event::KeyEvent;
use std::fmt;
use std::sync::mpsc;
@ -36,8 +36,6 @@ impl From<mpsc::RecvError> for EventError {
#[derive(Clone, Copy, Debug)]
pub enum Event {
Key(KeyEvent),
Mouse(MouseEvent),
Resize(u16, u16),
}
pub struct EventChannel {

View File

@ -41,8 +41,6 @@ impl<APP: IAppInteract> IEventHandler<APP> for EventHandler {
fn handle_next_event(&self, mut app: APP) -> Result<APP, EventError> {
match self.events.recv()? {
Event::Key(key_event) => app = Self::handle_key_event(app, key_event),
Event::Mouse(_) => {}
Event::Resize(_, _) => {}
};
Ok(app)
}

View File

@ -33,9 +33,7 @@ impl IEventListener for EventListener {
Ok(event) => {
if let Err(err) = match event {
CrosstermEvent::Key(e) => self.events.send(Event::Key(e)),
CrosstermEvent::Mouse(e) => self.events.send(Event::Mouse(e)),
CrosstermEvent::Resize(w, h) => self.events.send(Event::Resize(w, h)),
_ => unimplemented!(),
_ => Ok(()),
} {
return err;
}

View File

@ -231,13 +231,13 @@ impl<'a> ArtistOverlay<'a> {
let indent = format!("\n{item_indent}");
let list = vec
.iter()
.map(|(k, v)| format!("{k}: {}", Self::vec_to_string(v, list_indent)))
.map(|(k, v)| format!("{k}: {}", Self::slice_to_string(v, list_indent)))
.collect::<Vec<String>>()
.join(&indent);
format!("{indent}{list}")
}
fn vec_to_string<S: AsRef<str>>(vec: &Vec<S>, indent: &str) -> String {
fn slice_to_string<S: AsRef<str>>(vec: &[S], indent: &str) -> String {
if vec.len() < 2 {
vec.first()
.map(|item| item.as_ref())

Binary file not shown.