diff --git a/.github/workflows/generic.yaml b/.github/workflows/generic.yaml index 456794af..d35dc132 100644 --- a/.github/workflows/generic.yaml +++ b/.github/workflows/generic.yaml @@ -15,6 +15,10 @@ jobs: run: working-directory: main/tictactoe_generic steps: + - name: Set up Rust + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: stable - name: Checkout generic uses: actions/checkout@v4 with: diff --git a/.github/workflows/rust.yaml b/.github/workflows/rust.yaml index 36ad6e8e..6804d06d 100644 --- a/.github/workflows/rust.yaml +++ b/.github/workflows/rust.yaml @@ -20,6 +20,11 @@ jobs: steps: - name: Checkout repo uses: actions/checkout@v4 + - name: Set up Rust + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: stable + rustflags: "" - name: Lint run: | rustup component add clippy diff --git a/tictactoe_rust/Cargo.lock b/tictactoe_rust/Cargo.lock index 93398946..b4a60cb4 100644 --- a/tictactoe_rust/Cargo.lock +++ b/tictactoe_rust/Cargo.lock @@ -1,12 +1,12 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "bitflags" @@ -28,9 +28,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "getrandom" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71393ecc86efbf00e4ca13953979ba8b94cfe549a4b74cc26d8b62f4d8feac2b" +checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" dependencies = [ "cfg-if", "libc", @@ -64,9 +64,9 @@ checksum = "cf186d1a8aa5f5bee5fd662bc9c1b949e0259e1bcc379d1f006847b0080c7417" [[package]] name = "libc" -version = "0.2.158" +version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "memoffset" @@ -79,15 +79,15 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" [[package]] name = "portable-atomic" -version = "1.7.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265" +checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" [[package]] name = "ppv-lite86" @@ -100,9 +100,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] @@ -172,9 +172,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] @@ -187,7 +187,7 @@ checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" dependencies = [ "rand_chacha", "rand_core", - "zerocopy 0.8.14", + "zerocopy 0.8.20", ] [[package]] @@ -202,12 +202,12 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b08f3c9802962f7e1b25113931d94f43ed9725bebc59db9d0c3e9a23b67e15ff" +checksum = "a88e0da7a2c97baa202165137c158d0a2e824ac465d13d81046727b34cb247d3" dependencies = [ "getrandom", - "zerocopy 0.8.14", + "zerocopy 0.8.20", ] [[package]] @@ -249,9 +249,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.77" +version = "2.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" dependencies = [ "proc-macro2", "quote", @@ -282,9 +282,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe" [[package]] name = "unicode-segmentation" @@ -392,11 +392,11 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.14" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a367f292d93d4eab890745e75a778da40909cab4d6ff8173693812f79c4a2468" +checksum = "dde3bb8c68a8f3f1ed4ac9221aad6b10cece3e60a8e2ea54a6a2dec806d0084c" dependencies = [ - "zerocopy-derive 0.8.14", + "zerocopy-derive 0.8.20", ] [[package]] @@ -412,9 +412,9 @@ dependencies = [ [[package]] name = "zerocopy-derive" -version = "0.8.14" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3931cb58c62c13adec22e38686b559c86a30565e16ad6e8510a337cedc611e1" +checksum = "eea57037071898bf96a6da35fd626f4f27e9cee3ead2a6c703cf09d472b2e700" dependencies = [ "proc-macro2", "quote", diff --git a/tictactoe_rust/clippy.toml b/tictactoe_rust/clippy.toml new file mode 100644 index 00000000..045317c8 --- /dev/null +++ b/tictactoe_rust/clippy.toml @@ -0,0 +1 @@ +allowed-duplicate-crates = ["zerocopy", "zerocopy-derive"] diff --git a/tictactoe_rust/tictactoe_rust/Cargo.toml b/tictactoe_rust/tictactoe_rust/Cargo.toml index d308435d..ddb96611 100644 --- a/tictactoe_rust/tictactoe_rust/Cargo.toml +++ b/tictactoe_rust/tictactoe_rust/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "tictactoe_rust" version = "0.1.0" -edition = "2021" +edition = "2024" authors = ["Jan-Eric bool { if row >= 3 || col >= 3 { - println!("Row {} or column {} are out of bounds. They have to be between 1 and 3 inclusive. Try again!", row+1, col+1); + println!( + "Row {} or column {} are out of bounds. They have to be between 1 and 3 inclusive. Try again!", + row + 1, + col + 1 + ); return false; } if self.board[row][col] != '-' { - println!("The position ({}, {}) has already been taken by a player! Please do your move on an empty position.", row+1, col+1); + println!( + "The position ({}, {}) has already been taken by a player! Please do your move on an empty position.", + row + 1, + col + 1 + ); return false; } self.board[row][col] = player; diff --git a/tictactoe_rust/tictactoe_rust_python/Cargo.toml b/tictactoe_rust/tictactoe_rust_python/Cargo.toml index 0bfa1444..64dd77fa 100644 --- a/tictactoe_rust/tictactoe_rust_python/Cargo.toml +++ b/tictactoe_rust/tictactoe_rust_python/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "tictactoe_rust_python" version = "0.1.0" -edition = "2021" +edition = "2024" authors = ["Jan-Eric