Skip to content

Commit

Permalink
Set MSRV to 1.64 (#124)
Browse files Browse the repository at this point in the history
* Take care of clippy hint

* Set MSRV to 1.64

* Take care of clippy warning on nightly
  • Loading branch information
noeddl committed May 7, 2024
1 parent aa797b0 commit 92d1fd9
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- stable
- beta
- nightly
- 1.56.0 # MSRV
- 1.64.0 # MSRV

steps:
- uses: actions/checkout@v2
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ homepage = "https://github.com/noeddl/ukebox"
repository = "https://github.com/noeddl/ukebox"
keywords = ["ukulele", "chords", "music", "cli"]
categories = ["command-line-utilities"]
rust-version = "1.64"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Documentation](https://docs.rs/ukebox/badge.svg)](https://docs.rs/ukebox)
[![Continuous integration](https://github.com/noeddl/ukebox/actions/workflows/ci.yml/badge.svg)](https://github.com/noeddl/ukebox/actions/workflows/ci.yml)
[![license](https://img.shields.io/crates/l/ukebox)](#license)
[![rustc](https://img.shields.io/badge/rustc-1.56+-lightgray.svg)](https://blog.rust-lang.org/2021/10/21/Rust-1.56.0.html)
[![rustc](https://img.shields.io/badge/rustc-1.64+-lightgray.svg)](https://blog.rust-lang.org/2022/09/22/Rust-1.64.0.html)

`ukebox` is a ukulele chord toolbox for the command line written in Rust.

Expand Down
7 changes: 5 additions & 2 deletions src/chord_chart.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::cmp::max;
use std::fmt;
use std::fmt::Write;

use crate::{FretID, Semitones, UkeString, Voicing, MIN_CHART_WIDTH};

Expand Down Expand Up @@ -76,8 +77,10 @@ impl ChordChart {
"-".to_string()
}
})
.map(|c| format!("-{}-|", c))
.collect();
.fold(String::new(), |mut output, c| {
let _ = write!(output, "-{c}-|");
output
});

format!("{} {}{}{}- {}\n", root_str, sym, nut, s, note)
}
Expand Down
7 changes: 2 additions & 5 deletions src/voicing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,7 @@ impl Voicing {

/// Return the lowest fret at which a string is pressed down.
pub fn get_min_pressed_fret(&self) -> FretID {
match self.frets().filter(|&x| x > 0).min() {
Some(x) => x,
// Special case [0, 0, 0, 0]: no string is pressed down.
_ => 0,
}
self.frets().filter(|&x| x > 0).min().unwrap_or_default()
}

/// Return the lowest fret involved in playing the chord voicing
Expand Down Expand Up @@ -338,6 +334,7 @@ mod tests {

#[rstest(
frets, min_pressed_fret, min_fret, max_fret, span,
// Special case [0, 0, 0, 0]: no string is pressed down.
case([0, 0, 0, 0], 0, 0, 0, 0),
case([1, 1, 1, 1], 1, 1, 1, 1),
case([2, 0, 1, 3], 1, 0, 3, 3),
Expand Down

0 comments on commit 92d1fd9

Please sign in to comment.