Skip to content

Commit

Permalink
Upgrade to Rust 1.72.0
Browse files Browse the repository at this point in the history
  • Loading branch information
stepchowfun committed Aug 25, 2023
1 parent 10da872 commit bebdcb2
Show file tree
Hide file tree
Showing 13 changed files with 210 additions and 111 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ jobs:
set -euo pipefail
# Install the appropriate version of Rust.
rustup toolchain install 1.65.0 # [ref:rust_1.65.0]
rustup default 1.65.0 # [ref:rust_1.65.0]
rustup toolchain install 1.72.0 # [ref:rust_1.72.0]
rustup default 1.72.0 # [ref:rust_1.72.0]
# Add the targets.
rustup target add x86_64-pc-windows-msvc
Expand Down Expand Up @@ -120,8 +120,8 @@ jobs:
set -euo pipefail
# Install the appropriate version of Rust.
rustup toolchain install 1.65.0 # [ref:rust_1.65.0]
rustup default 1.65.0 # [ref:rust_1.65.0]
rustup toolchain install 1.72.0 # [ref:rust_1.72.0]
rustup default 1.72.0 # [ref:rust_1.72.0]
# Add the targets.
rustup target add x86_64-apple-darwin
Expand Down Expand Up @@ -193,8 +193,8 @@ jobs:
set -euo pipefail
# Install the appropriate version of Rust.
rustup toolchain install 1.65.0 # [ref:rust_1.65.0]
rustup default 1.65.0 # [ref:rust_1.65.0]
rustup toolchain install 1.72.0 # [ref:rust_1.72.0]
rustup default 1.72.0 # [ref:rust_1.72.0]
# Fetch the program version.
VERSION="$(cargo pkgid | cut -d# -f2 | cut -d: -f2)"
Expand Down
199 changes: 151 additions & 48 deletions 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 src/count.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// multiplicity (pluralizing if necessary). For example, `count(3, "cow")` becomes "3 cows".
pub fn count(n: usize, noun: &str) -> String {
if n == 1 {
format!("{} {}", n, noun)
format!("{n} {noun}")
} else {
format!("{} {}s", n, noun)
format!("{n} {noun}s")
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ impl CodeStr for str {
if SHOULD_COLORIZE.should_colorize() {
self.magenta()
} else {
ColoredString::from(&format!("`{}`", self) as &Self)
ColoredString::from(&format!("`{self}`") as &Self)
}
}
}
Expand Down
7 changes: 3 additions & 4 deletions src/generate_rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pub fn generate(
writeln!(
&mut buffer,
"\
// This file was automatically generated by Typical {}.
// This file was automatically generated by Typical {typical_version}.
// Visit https://github.com/stepchowfun/typical for more information.
use std::{{
Expand Down Expand Up @@ -326,7 +326,6 @@ fn finish<T: BufRead>(reader: &mut T) -> io::Result<()> {{
reader.consume(buffer_size);
}}
}}",
typical_version,
)
.unwrap();

Expand Down Expand Up @@ -1694,15 +1693,15 @@ fn write_identifier<T: Write>(
write!(buffer, "r#")?;
}

write!(buffer, "{}", converted_identifier)?;
write!(buffer, "{converted_identifier}")?;

Ok(())
}

// Write the given level of indentation.
fn write_indentation<T: Write>(buffer: &mut T, indentation: usize) -> Result<(), fmt::Error> {
for _ in 0..indentation {
write!(buffer, "{}", INDENTATION)?;
write!(buffer, "{INDENTATION}")?;
}

Ok(())
Expand Down
Loading

0 comments on commit bebdcb2

Please sign in to comment.