clippy --fix fixes

This commit is contained in:
Folkert 2023-04-21 12:05:51 +02:00
parent 9973d4b8d2
commit 4cd8f0a056
57 changed files with 366 additions and 374 deletions

View file

@ -21,9 +21,9 @@ use crate::{Ast, Buf};
/// The number of spaces to indent.
pub const INDENT: u16 = 4;
pub fn fmt_default_spaces<'a, 'buf>(
buf: &mut Buf<'buf>,
spaces: &[CommentOrNewline<'a>],
pub fn fmt_default_spaces(
buf: &mut Buf<'_>,
spaces: &[CommentOrNewline<'_>],
indent: u16,
) {
if spaces.is_empty() {
@ -32,9 +32,9 @@ pub fn fmt_default_spaces<'a, 'buf>(
fmt_spaces(buf, spaces.iter(), indent);
}
}
pub fn fmt_default_newline<'a, 'buf>(
buf: &mut Buf<'buf>,
spaces: &[CommentOrNewline<'a>],
pub fn fmt_default_newline(
buf: &mut Buf<'_>,
spaces: &[CommentOrNewline<'_>],
indent: u16,
) {
if spaces.is_empty() {
@ -153,7 +153,7 @@ pub fn fmt_comments_only<'a, 'buf, I>(
}
}
fn fmt_comment<'buf>(buf: &mut Buf<'buf>, comment: &str) {
fn fmt_comment(buf: &mut Buf<'_>, comment: &str) {
// The '#' in a comment should always be preceded by a newline or a space,
// unless it's the very beginning of the buffer.
if !buf.is_empty() && !buf.ends_with_space() && !buf.ends_with_newline() {
@ -192,7 +192,7 @@ where
count
}
fn fmt_docs<'buf>(buf: &mut Buf<'buf>, docs: &str) {
fn fmt_docs(buf: &mut Buf<'_>, docs: &str) {
// The "##" in a doc comment should always be preceded by a newline or a space,
// unless it's the very beginning of the buffer.
if !buf.is_empty() && !buf.ends_with_space() && !buf.ends_with_newline() {