Skip to content

Commit

Permalink
Merge branch 'fix-clippy-nightly' into 'master'
Browse files Browse the repository at this point in the history
Fix minor clippy +nightly lints

See merge request mkjeldsen/commitmsgfmt!73
  • Loading branch information
commonquail committed Nov 8, 2023
2 parents 0aa2117 + 54e69ee commit 53132f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions src/commitmsgfmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ impl CommitMsgFmt {
fn reflow_into(&self, buf: &mut String, msg: &[Token]) {
for tok in msg {
match *tok {
BlockQuote(ref s) | Comment(ref s) | Literal(ref s) | Scissored(ref s)
| Trailer(ref s) => {
BlockQuote(s) | Comment(s) | Literal(s) | Scissored(s) | Trailer(s) => {
buf.push_str(s);
}
ListItem(ref indent, ref li, ref s) => {
Expand All @@ -55,13 +54,13 @@ impl CommitMsgFmt {
Paragraph(ref p) => {
self.wrap_paragraph_into(buf, p, None);
}
Footnote(ref key, ref rest) => {
Footnote(key, ref rest) => {
buf.push_str(key);
buf.push(' ');
let continuation = " ".repeat(key.graphemes(true).count() + 1);
self.wrap_paragraph_into(buf, rest.trim(), Some(&continuation));
}
Subject(ref s) => {
Subject(s) => {
buf.push_str(s);
}
VerticalSpace => {}
Expand Down
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ pub struct Config {
}

impl Config {
fn new<'a>(args: Vec<ConfigArgument<'a>>) -> CliResult<'a, Config> {
fn new(args: Vec<ConfigArgument<'_>>) -> CliResult<'_, Config> {
let mut width: Option<&str> = None;
for arg in args {
match arg {
Expand All @@ -135,7 +135,7 @@ impl Config {
}

let width = width
.map(|w| i32::from_str_radix(w, 10).map_err(|_| CliError::ArgWidthNaN(w.into())))
.map(|w| w.parse().map_err(|_| CliError::ArgWidthNaN(w.into())))
.transpose()?
.unwrap_or(72);

Expand Down Expand Up @@ -194,7 +194,7 @@ fn main() {

fn try_config_from_command_line(args: &'_ [String]) -> CliResult<'_, Config> {
let (binary_path, args) = args.split_first().expect("binary has name");
parse_args(&args)
parse_args(args)
.into_iter()
.try_fold(vec![], |mut acc, arg| match arg {
CliArgument::HelpLong => Err(CliError::EarlyExit(
Expand Down

0 comments on commit 53132f5

Please sign in to comment.