From ada721ae6435b485f4750f900c581ff723429ba5 Mon Sep 17 00:00:00 2001 From: primenumber Date: Tue, 2 Apr 2024 22:56:11 +0900 Subject: [PATCH] Apply rustfmt --- src/engine/board.rs | 9 ++++++--- src/record.rs | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/engine/board.rs b/src/engine/board.rs index 5585e6b..ac4bdf2 100644 --- a/src/engine/board.rs +++ b/src/engine/board.rs @@ -1,11 +1,11 @@ #[cfg(test)] mod test; -#[cfg(target_feature = "neon")] -use std::arch::aarch64::*; use crate::engine::bits::*; use crate::engine::hand::*; use anyhow::Result; use clap::ArgMatches; +#[cfg(target_feature = "neon")] +use std::arch::aarch64::*; use std::cmp::min; use std::fmt; use std::io::{BufWriter, Write}; @@ -55,7 +55,10 @@ fn smart_upper_bit(x: u64x4) -> u64x4 { } } -#[cfg(not(any(target_feature = "neon", all(target_feature = "avx512cd", target_feature = "avx512vl"))))] +#[cfg(not(any( + target_feature = "neon", + all(target_feature = "avx512cd", target_feature = "avx512vl") +)))] fn smart_upper_bit(mut x: u64x4) -> u64x4 { x |= x >> u64x4::from_array([8, 1, 7, 9]); x |= x >> u64x4::from_array([16, 2, 14, 18]); diff --git a/src/record.rs b/src/record.rs index 90a0328..cabdc66 100644 --- a/src/record.rs +++ b/src/record.rs @@ -28,7 +28,7 @@ impl Record { for i in 0..(l / 2) { let h = Hand::from_str(&record_str[(2 * i)..(2 * i + 2)])?; hands.push(h); - board = board.play_hand(h).ok_or(UnmovableError{})?; + board = board.play_hand(h).ok_or(UnmovableError {})?; } let score = if let Some(score) = splitted.get(1) { score.parse().unwrap() @@ -52,7 +52,7 @@ impl Record { }; for &h in &self.hands { res.push((board, h, score)); - board = board.play_hand(h).ok_or(UnmovableError{})?; + board = board.play_hand(h).ok_or(UnmovableError {})?; score = -score; } res.push((board, Hand::Pass, score));