@@ -1,7 +1,7 @@
[package]
name = "guessing-game"
-version = "0.1.0"
-edition = "2021"
+version = "0.3.0"
+edition = "2024"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@@ -11,10 +11,10 @@ name = "guessing_game"
crate-type = ["cdylib"]
[dependencies]
-rand = "0.8.4"
+rand = "0.9.0"
[dependencies.pyo3]
-version = "0.24.1"
-# "abi3-py38" tells pyo3 (and maturin) to build using the stable ABI with minimum Python version 3.8
-features = ["abi3-py38"]
+version = "0.27.2"
+# "abi3-py39" tells pyo3 (and maturin) to build using the stable ABI with minimum Python version 3.9
+features = ["abi3-py39"]
@@ -1,5 +1,5 @@
[build-system]
-requires = ["maturin>=1.0,<2.0"]
+requires = ["maturin>=1.7,<2.0"]
build-backend = "maturin"
[tool.maturin]
@@ -7,7 +7,7 @@ use std::io;
fn guess_the_number() {
println!("Guess the number!");
- let secret_number = rand::thread_rng().gen_range(1..101);
+ let secret_number = rand::rng().random_range(1..101);
loop {
println!("Please input your guess.");
@@ -40,7 +40,7 @@ fn guess_the_number() {
/// the `lib.name` setting in the `Cargo.toml`, else Python will not be able to
/// import the module.
#[pymodule]
-fn guessing_game(_py: Python, m: &PyModule) -> PyResult<()> {
+fn guessing_game(m: &Bound<'_, PyModule>) -> PyResult<()> {
m.add_function(wrap_pyfunction!(guess_the_number, m)?)?;
Ok(())