From e327f00aa85864b2ad4db505eca9ee926e524900 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sp=C3=B6ttel?= <1682504+fspoettel@users.noreply.github.com> Date: Sat, 29 Oct 2022 17:18:58 +0200 Subject: [PATCH] fix: fix clippy lint --- src/helpers.rs | 6 ++++-- src/lib.rs | 8 +++++--- src/main.rs | 13 ++++++++++++- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index e2db615..1a515ea 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -1,2 +1,4 @@ -// Use this file if you want to extract sections of your solutions. -// Example import: `use aoc::helpers::example_fn;` +/* + * Use this file if you want to extract helpers from your solutions. + * Example import from this file: `use aoc::helpers::example_fn;` + */ diff --git a/src/lib.rs b/src/lib.rs index 5b85149..6fbbd71 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,7 @@ -// This file contains template helpers. -// Prefer `./helpers.rs` if you want to extract code from your solutions. +/* + * This file contains template helpers. + * Prefer `./helpers.rs` if you want to extract code from your solutions. + */ use std::env; use std::fs; @@ -26,7 +28,7 @@ macro_rules! solve { "{} {}(elapsed: {:.2?}){}", result, ANSI_ITALIC, elapsed, ANSI_RESET ); - }, + } None => { println!("not solved.") } diff --git a/src/main.rs b/src/main.rs index 42f4acd..298443d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,7 @@ +/* + * This file contains template code. + * Unless you want to change how solutions are invoked, this file does not need to be edited. + */ use aoc::{ANSI_BOLD, ANSI_ITALIC, ANSI_RESET}; use std::process::Command; @@ -18,7 +22,14 @@ fn main() { let output = String::from_utf8(cmd.stdout).unwrap(); let is_empty = output.is_empty(); - println!("{}", if is_empty { "Not solved." } else { &output.trim() }); + println!( + "{}", + if is_empty { + "Not solved." + } else { + output.trim() + } + ); if is_empty { 0_f64