Skip to content

Commit

Permalink
Deal with CRLF on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
caass committed Oct 29, 2024
1 parent 752b17b commit c9a33c7
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 18 deletions.
16 changes: 16 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ memchr = "2.7.4"
clap = { version = "4.5.20", features = ["derive"] }
clap-stdin = "0.5.1"
pathsep = "0.1.1"
newline-converter = "0.3.0"

[target.'cfg(windows)'.dependencies]
md-5 = "0.10.6"
Expand Down
37 changes: 19 additions & 18 deletions src/2016/08.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
use std::{
fmt::{self, Display, Formatter, Write},
str::FromStr,
};
use std::fmt::{self, Display, Formatter, Write};
use std::str::FromStr;

use eyre::{bail, eyre, Report, Result};
use newline_converter::AsRefStrExt;
use rayon::prelude::*;
use winnow::{
ascii::dec_uint,
Expand Down Expand Up @@ -159,24 +158,26 @@ impl<const W: usize> Screen<W, 6> {
impl Screen<5, 6> {
fn letter(&self) -> Result<char> {
macro_rules! LETTERS {
($($letter:ident),+) => {$(
const $letter: &str = include_str!(concat!(
env!("CARGO_MANIFEST_DIR"),
::pathsep::path_separator!(),
"fixtures",
::pathsep::path_separator!(),
"2016",
::pathsep::path_separator!(),
"08",
::pathsep::path_separator!(),
stringify!($letter)
));
)+};
($($letter:ident),+) => {
$(
const $letter: &str = include_str!(concat!(
env!("CARGO_MANIFEST_DIR"),
::pathsep::path_separator!(),
"fixtures",
::pathsep::path_separator!(),
"2016",
::pathsep::path_separator!(),
"08",
::pathsep::path_separator!(),
stringify!($letter)
));
)+
};
}

LETTERS!(A, B, C, D, E, F, I, J, K, L, O, P, R, S, U, Y, Z);

match self.to_string().as_str() {
match self.to_string().to_unix().as_ref() {
A => Ok('A'),
B => Ok('B'),
C => Ok('C'),
Expand Down

0 comments on commit c9a33c7

Please sign in to comment.