Skip to content

Commit

Permalink
fix: rename package to advent_of_code (#13)
Browse files Browse the repository at this point in the history
`aoc` shadowed the `aoc-cli` binary which could lead to issues.

closes #12
  • Loading branch information
fspoettel authored Nov 29, 2022
1 parent 9bc635a commit d0b923f
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 22 deletions.
18 changes: 9 additions & 9 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in executable 'aoc'",
"name": "Debug unit tests in executable 'advent_of_code'",
"cargo": {
"args": ["test", "--no-run", "--bin=aoc", "--package=aoc"],
"args": ["test", "--no-run", "--bin=advent_of_code", "--package=advent_of_code"],
"filter": {
"name": "aoc",
"name": "advent_of_code",
"kind": "bin"
}
},
Expand All @@ -21,11 +21,11 @@
{
"type": "lldb",
"request": "launch",
"name": "Debug executable 'aoc'",
"name": "Debug executable 'advent_of_code'",
"cargo": {
"args": ["build", "--bin=aoc", "--package=aoc"],
"args": ["build", "--bin=advent_of_code", "--package=advent_of_code"],
"filter": {
"name": "aoc",
"name": "advent_of_code",
"kind": "bin"
}
},
Expand All @@ -35,11 +35,11 @@
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in library 'aoc'",
"name": "Debug unit tests in library 'advent_of_code'",
"cargo": {
"args": ["test", "--no-run", "--lib", "--package=aoc"],
"args": ["test", "--no-run", "--lib", "--package=advent_of_code"],
"filter": {
"name": "aoc",
"name": "advent_of_code",
"kind": "lib"
}
},
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
name = "aoc"
name = "advent_of_code"
version = "0.7.0"
authors = ["Felix Spöttel <[email protected]>"]
edition = "2021"
default-run = "aoc"
default-run = "advent_of_code"
publish = false
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Displayed _timings_ show the raw execution time of your solution without overhea
cargo all

# output:
# Running `target/release/aoc`
# Running `target/release/advent_of_code`
# ----------
# | Day 01 |
# ----------
Expand Down
10 changes: 5 additions & 5 deletions src/bin/scaffold.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ pub fn part_two(input: &str) -> Option<u32> {
}
fn main() {
let input = &aoc::read_file("inputs", DAY);
aoc::solve!(1, part_one, input);
aoc::solve!(2, part_two, input);
let input = &advent_of_code::read_file("inputs", DAY);
advent_of_code::solve!(1, part_one, input);
advent_of_code::solve!(2, part_two, input);
}
#[cfg(test)]
Expand All @@ -28,13 +28,13 @@ mod tests {
#[test]
fn test_part_one() {
let input = aoc::read_file("examples", DAY);
let input = advent_of_code::read_file("examples", DAY);
assert_eq!(part_one(&input), None);
}
#[test]
fn test_part_two() {
let input = aoc::read_file("examples", DAY);
let input = advent_of_code::read_file("examples", DAY);
assert_eq!(part_two(&input), None);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/helpers.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
* Use this file if you want to extract helpers from your solutions.
* Example import from this file: `use aoc::helpers::example_fn;`.
* Example import from this file: `use advent_of_code::helpers::example_fn;`.
*/
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub const ANSI_RESET: &str = "\x1b[0m";
#[macro_export]
macro_rules! solve {
($part:expr, $solver:ident, $input:expr) => {{
use aoc::{ANSI_BOLD, ANSI_ITALIC, ANSI_RESET};
use advent_of_code::{ANSI_BOLD, ANSI_ITALIC, ANSI_RESET};
use std::fmt::Display;
use std::time::Instant;

Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file contains template code.
* There is no need to edit this file unless you want to change template functionality.
*/
use aoc::{ANSI_BOLD, ANSI_ITALIC, ANSI_RESET};
use advent_of_code::{ANSI_BOLD, ANSI_ITALIC, ANSI_RESET};
use std::process::Command;

fn main() {
Expand Down Expand Up @@ -34,7 +34,7 @@ fn main() {
if is_empty {
0_f64
} else {
aoc::parse_exec_time(&output)
advent_of_code::parse_exec_time(&output)
}
})
.sum();
Expand Down

0 comments on commit d0b923f

Please sign in to comment.