Skip to content

Commit

Permalink
Ran cargo clippy --fix
Browse files Browse the repository at this point in the history
  • Loading branch information
datawater committed Aug 17, 2024
1 parent a3b525a commit a7d89fa
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 12 deletions.
7 changes: 7 additions & 0 deletions Cargo.lock

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

7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ codegen-units = 1
panic = "abort"

[profile.dev]
opt-level = 1
opt-level = 0
incremental = true
codegen-units = 2048
split-debuginfo = "unpacked"
lto = "off"

[profile.profile]
inherits = "release"
Expand All @@ -46,8 +47,8 @@ opt-level = "z"
[profile.test]
codegen-units = 2048
incremental = true
lto = true
opt-level = 3
lto = false
opt-level = 0

[dev-dependencies]
project-root = "0.2.2"
7 changes: 4 additions & 3 deletions NOTICE.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ <h1>Third Party Licenses</h1>

<h2>Overview of licenses:</h2>
<ul class="licenses-overview">
<li><a href="#Apache-2.0">Apache License 2.0</a> (38)</li>
<li><a href="#Apache-2.0">Apache License 2.0</a> (39)</li>
<li><a href="#MIT">MIT License</a> (8)</li>
<li><a href="#GPL-3.0">GNU General Public License v3.0 only</a> (4)</li>
<li><a href="#Unicode-3.0">Unicode License v3</a> (1)</li>
Expand Down Expand Up @@ -893,6 +893,7 @@ <h4>Used by:</h4>
<h3 id="Apache-2.0">Apache License 2.0</h3>
<h4>Used by:</h4>
<ul class="license-used-by">
<li><a href=" https://github.com/contain-rs/bit-vec ">bit-vec 0.8.0</a></li>
<li><a href=" https://github.com/Alexhuszagh/minimal-lexical ">minimal-lexical 0.2.1</a></li>
</ul>
<pre class="license-text"> Apache License
Expand Down Expand Up @@ -1481,8 +1482,8 @@ <h4>Used by:</h4>
<h3 id="Apache-2.0">Apache License 2.0</h3>
<h4>Used by:</h4>
<ul class="license-used-by">
<li><a href=" https://github.com/SoftbearStudios/bitcode ">bitcode 0.6.0</a></li>
<li><a href=" https://github.com/SoftbearStudios/bitcode/ ">bitcode_derive 0.6.0</a></li>
<li><a href=" https://github.com/SoftbearStudios/bitcode ">bitcode 0.6.3</a></li>
<li><a href=" https://github.com/SoftbearStudios/bitcode/ ">bitcode_derive 0.6.3</a></li>
<li><a href=" https://github.com/neilwashere/rust-project-root ">project-root 0.2.2</a></li>
<li><a href=" https://github.com/jedisct1/rust-siphash ">siphasher 0.3.11</a></li>
</ul>
Expand Down
7 changes: 3 additions & 4 deletions libcmbr/src/position/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ impl CompressedPositionConvertable<Chess> for Chess {

// SAFE: Safe
let piece = unsafe {
(bitvec.get_unchecked(read_piece_count * 4 + 0) as u8) << 0
(bitvec.get_unchecked(read_piece_count * 4) as u8)
| (bitvec.get_unchecked(read_piece_count * 4 + 1) as u8) << 1
| (bitvec.get_unchecked(read_piece_count * 4 + 2) as u8) << 2
| (bitvec.get_unchecked(read_piece_count * 4 + 3) as u8) << 3
Expand Down Expand Up @@ -174,7 +174,7 @@ impl CompressedPositionConvertable<Chess> for Chess {

bitvec_i += 1;

let can_castle_wk = if bitvec.get(bitvec_i + 0).unwrap() {
let can_castle_wk = if bitvec.get(bitvec_i).unwrap() {
"K"
} else {
""
Expand Down Expand Up @@ -211,7 +211,7 @@ impl CompressedPositionConvertable<Chess> for Chess {
bitvec_i += 4;

let en_passant_bits = unsafe {
(bitvec.get_unchecked(bitvec_i + 0) as u8) << 0
(bitvec.get_unchecked(bitvec_i) as u8)
| (bitvec.get(bitvec_i + 1).unwrap() as u8) << 1
| (bitvec.get(bitvec_i + 2).unwrap() as u8) << 2
| (bitvec.get(bitvec_i + 3).unwrap() as u8) << 3
Expand Down Expand Up @@ -299,7 +299,6 @@ mod tests {
b.iter(|| {
let pytorch_position = Chess::to_pytorch_position(&position);
});

}
}
}
1 change: 0 additions & 1 deletion src/eval_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use std::fs::File;
use std::io::Write;

pub fn eval_args(cli: &Cli) {

match cli.command.as_ref().unwrap() {
crate::CommandE::Cmbr2pgn(_args) => {
todo!()
Expand Down
4 changes: 3 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::needless_return)]

mod eval_args;
mod utils;

Expand Down Expand Up @@ -40,7 +42,7 @@ enum ParseMemoryError {

fn parse_memory_amount(s: &str) -> Result<u64, ParseMemoryError> {
let pos = s
.find(|c: char| !c.is_digit(10))
.find(|c: char| !c.is_ascii_digit())
.ok_or(ParseMemoryError::InvalidFormat)?;

let (number_str, unit_str) = s.split_at(pos);
Expand Down

0 comments on commit a7d89fa

Please sign in to comment.