Skip to content

Commit a3cc3a7

Browse files
committed
refactor: rename main! macro to solution!
1 parent 6d9bf34 commit a3cc3a7

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/template/commands/scaffold.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ use std::{
66

77
use crate::Day;
88

9-
const MODULE_TEMPLATE: &str = r#"pub fn part_one(input: &str) -> Option<u32> {
9+
const MODULE_TEMPLATE: &str = r#"advent_of_code::solution!(DAY_NUMBER);
10+
11+
pub fn part_one(input: &str) -> Option<u32> {
1012
None
1113
}
1214
1315
pub fn part_two(input: &str) -> Option<u32> {
1416
None
1517
}
1618
17-
advent_of_code::main!(DAY_NUMBER);
18-
1919
#[cfg(test)]
2020
mod tests {
2121
use super::*;

src/template/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ pub fn read_file(folder: &str, day: Day) -> String {
1919
f.expect("could not open input file")
2020
}
2121

22-
/// main! produces a block setting up the input and runner for each part.
22+
/// Creates the constant `DAY` and sets up the input and runner for each part.
2323
#[macro_export]
24-
macro_rules! main {
24+
macro_rules! solution {
2525
($day:expr) => {
2626
/// The current day.
2727
const DAY: advent_of_code::Day = advent_of_code::day!($day);

0 commit comments

Comments
 (0)