Skip to content

Commit

Permalink
lint + fmt (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
awnion authored Oct 5, 2023
1 parent f1b0e94 commit fabd570
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ env:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- uses: actions/checkout@v3
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,12 @@ pub fn name_to_index_path(crate_name: &str) -> String {
1 => format!("1/{}", crate_name),
2 => format!("2/{}", crate_name),
3 => {
let mut first_char = crate_name.clone().to_string();
let mut first_char = crate_name.to_string();
first_char.truncate(1);
format!("3/{}/{}", first_char, crate_name)
}
_ => {
let mut header_iter =
crate_name.clone().as_bytes().chunks(2).map(String::from_utf8_lossy);
let mut header_iter = crate_name.as_bytes().chunks(2).map(String::from_utf8_lossy);
format!(
"{}/{}/{}",
header_iter.next().unwrap(),
Expand Down
2 changes: 1 addition & 1 deletion clippy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ disallowed-methods = [
"std::env::temp_dir", # Use the tempdir crate instead # There are many things that aren"t allowed on wasm,
# but we cannot disable them all here (because of e.g. https://github.com/rust-lang/rust-clippy/issues/10406)
# so we do that in `clipppy_wasm.toml` instead.
"std::thread::spawn", # Use `std::thread::Builder` and name the thread
"std::thread::spawn", # Use `std::thread::Builder` and name the thread
## INFO: in anytree project we have to use this algo anyway
# "sha1::Digest::new", # SHA1 is cryptographically broken
"std::panic::catch_unwind", # We compile with `panic = "abort"`
Expand Down

0 comments on commit fabd570

Please sign in to comment.