From aa0a6af95bc49cadf8682bd81f8c0e22f25471df Mon Sep 17 00:00:00 2001 From: Matthijs Kok Date: Mon, 27 Oct 2025 11:33:28 +0100 Subject: [PATCH] Update docs for maturin build backend init template --- docs/concepts/projects/init.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/docs/concepts/projects/init.md b/docs/concepts/projects/init.md index 9df3e281b317f..35a397f0cc0b1 100644 --- a/docs/concepts/projects/init.md +++ b/docs/concepts/projects/init.md @@ -269,15 +269,14 @@ The Rust library defines a simple function: ```rust title="src/lib.rs" use pyo3::prelude::*; -#[pyfunction] -fn hello_from_bin() -> String { - "Hello from example-ext!".to_string() -} - #[pymodule] -fn _core(m: &Bound<'_, PyModule>) -> PyResult<()> { - m.add_function(wrap_pyfunction!(hello_from_bin, m)?)?; - Ok(()) +mod _core { + use pyo3::prelude::*; + + #[pyfunction] + fn hello_from_bin() -> String { + "Hello from example-ext!".to_string() + } } ```