parent
f395433343
commit
8ff09e66ba
@ -1,4 +1,4 @@
|
|||||||
FROM docker.io/library/rust:1.79
|
FROM docker.io/library/rust:1.80
|
||||||
|
|
||||||
RUN rustup component add \
|
RUN rustup component add \
|
||||||
clippy \
|
clippy \
|
||||||
|
@ -13,7 +13,7 @@ env:
|
|||||||
jobs:
|
jobs:
|
||||||
build_and_test:
|
build_and_test:
|
||||||
name: Build and Test
|
name: Build and Test
|
||||||
container: docker.io/drrobot/musichoard-ci:rust-1.79
|
container: docker.io/drrobot/musichoard-ci:rust-1.80
|
||||||
env:
|
env:
|
||||||
BEETSDIR: ./
|
BEETSDIR: ./
|
||||||
LLVM_PROFILE_FILE: target/debug/profraw/musichoard-%p-%m.profraw
|
LLVM_PROFILE_FILE: target/debug/profraw/musichoard-%p-%m.profraw
|
||||||
@ -48,7 +48,7 @@ jobs:
|
|||||||
|
|
||||||
lint:
|
lint:
|
||||||
name: Lint
|
name: Lint
|
||||||
container: docker.io/drrobot/musichoard-ci:rust-1.75
|
container: docker.io/drrobot/musichoard-ci:rust-1.80
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- run: cargo clippy --no-default-features --all-targets -- -D warnings
|
- run: cargo clippy --no-default-features --all-targets -- -D warnings
|
||||||
|
3
build.rs
3
build.rs
@ -1,5 +1,6 @@
|
|||||||
fn main() {
|
fn main() {
|
||||||
|
println!("cargo::rustc-check-cfg=cfg(nightly)");
|
||||||
if let Some(true) = version_check::is_feature_flaggable() {
|
if let Some(true) = version_check::is_feature_flaggable() {
|
||||||
println!("cargo:rustc-cfg=nightly");
|
println!("cargo::rustc-cfg=nightly");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
6
src/external/library/beets/mod.rs
vendored
6
src/external/library/beets/mod.rs
vendored
@ -159,11 +159,7 @@ impl<BLE: IBeetsLibraryExecutor> BeetsLibrary<BLE> {
|
|||||||
let album_title = split[5].to_string();
|
let album_title = split[5].to_string();
|
||||||
let track_number = split[6].parse::<u32>()?;
|
let track_number = split[6].parse::<u32>()?;
|
||||||
let track_title = split[7].to_string();
|
let track_title = split[7].to_string();
|
||||||
let track_artist = split[8]
|
let track_artist = split[8].split("; ").map(|s| s.to_owned()).collect();
|
||||||
.to_string()
|
|
||||||
.split("; ")
|
|
||||||
.map(|s| s.to_owned())
|
|
||||||
.collect();
|
|
||||||
let track_format = match str_to_format(split[9].to_string().as_str()) {
|
let track_format = match str_to_format(split[9].to_string().as_str()) {
|
||||||
Some(format) => format,
|
Some(format) => format,
|
||||||
None => return Err(Error::Invalid(line.to_string())),
|
None => return Err(Error::Invalid(line.to_string())),
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crossterm::event::{KeyEvent, MouseEvent};
|
use crossterm::event::KeyEvent;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::sync::mpsc;
|
use std::sync::mpsc;
|
||||||
|
|
||||||
@ -36,8 +36,6 @@ impl From<mpsc::RecvError> for EventError {
|
|||||||
#[derive(Clone, Copy, Debug)]
|
#[derive(Clone, Copy, Debug)]
|
||||||
pub enum Event {
|
pub enum Event {
|
||||||
Key(KeyEvent),
|
Key(KeyEvent),
|
||||||
Mouse(MouseEvent),
|
|
||||||
Resize(u16, u16),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct EventChannel {
|
pub struct EventChannel {
|
||||||
|
@ -41,8 +41,6 @@ impl<APP: IAppInteract> IEventHandler<APP> for EventHandler {
|
|||||||
fn handle_next_event(&self, mut app: APP) -> Result<APP, EventError> {
|
fn handle_next_event(&self, mut app: APP) -> Result<APP, EventError> {
|
||||||
match self.events.recv()? {
|
match self.events.recv()? {
|
||||||
Event::Key(key_event) => app = Self::handle_key_event(app, key_event),
|
Event::Key(key_event) => app = Self::handle_key_event(app, key_event),
|
||||||
Event::Mouse(_) => {}
|
|
||||||
Event::Resize(_, _) => {}
|
|
||||||
};
|
};
|
||||||
Ok(app)
|
Ok(app)
|
||||||
}
|
}
|
||||||
|
@ -33,9 +33,7 @@ impl IEventListener for EventListener {
|
|||||||
Ok(event) => {
|
Ok(event) => {
|
||||||
if let Err(err) = match event {
|
if let Err(err) = match event {
|
||||||
CrosstermEvent::Key(e) => self.events.send(Event::Key(e)),
|
CrosstermEvent::Key(e) => self.events.send(Event::Key(e)),
|
||||||
CrosstermEvent::Mouse(e) => self.events.send(Event::Mouse(e)),
|
_ => Ok(()),
|
||||||
CrosstermEvent::Resize(w, h) => self.events.send(Event::Resize(w, h)),
|
|
||||||
_ => unimplemented!(),
|
|
||||||
} {
|
} {
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
@ -231,13 +231,13 @@ impl<'a> ArtistOverlay<'a> {
|
|||||||
let indent = format!("\n{item_indent}");
|
let indent = format!("\n{item_indent}");
|
||||||
let list = vec
|
let list = vec
|
||||||
.iter()
|
.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>>()
|
.collect::<Vec<String>>()
|
||||||
.join(&indent);
|
.join(&indent);
|
||||||
format!("{indent}{list}")
|
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 {
|
if vec.len() < 2 {
|
||||||
vec.first()
|
vec.first()
|
||||||
.map(|item| item.as_ref())
|
.map(|item| item.as_ref())
|
||||||
|
Loading…
Reference in New Issue
Block a user