many clippy fixes

This commit is contained in:
Anton-4 2023-04-24 16:21:46 +02:00
parent 7bbb37a843
commit 9748e4a4dc
No known key found for this signature in database
GPG key ID: 0971D718C0A9B937
17 changed files with 455 additions and 600 deletions

View file

@ -21,22 +21,14 @@ use crate::{Ast, Buf};
/// The number of spaces to indent.
pub const INDENT: u16 = 4;
pub fn fmt_default_spaces(
buf: &mut Buf,
spaces: &[CommentOrNewline],
indent: u16,
) {
pub fn fmt_default_spaces(buf: &mut Buf, spaces: &[CommentOrNewline], indent: u16) {
if spaces.is_empty() {
buf.spaces(1);
} else {
fmt_spaces(buf, spaces.iter(), indent);
}
}
pub fn fmt_default_newline(
buf: &mut Buf,
spaces: &[CommentOrNewline],
indent: u16,
) {
pub fn fmt_default_newline(buf: &mut Buf, spaces: &[CommentOrNewline], indent: u16) {
if spaces.is_empty() {
buf.newline();
} else {