Remove unneeded `return` from Maturin project template (#8604)

## Summary

This PR removes an unnecessary `return` statement from Rust code in the
Maturin template. This makes the generated code more idiomatic and
prevents a Clippy warning.

## Test Plan

This change was tested both in unit tests and by manually creating a
Maturin project.
This commit is contained in:
Vivien Maisonneuve 2024-10-27 15:15:27 +01:00 committed by GitHub
parent a09415f008
commit c648150ff0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -975,7 +975,7 @@ fn generate_package_scripts(
#[pyfunction]
fn hello_from_bin() -> String {{
return "Hello from {package}!".to_string();
"Hello from {package}!".to_string()
}}
/// A Python module implemented in Rust. The name of this function must match

View File

@ -2665,7 +2665,7 @@ fn init_app_build_backend_maturin() -> Result<()> {
#[pyfunction]
fn hello_from_bin() -> String {
return "Hello from foo!".to_string();
"Hello from foo!".to_string()
}
/// A Python module implemented in Rust. The name of this function must match
@ -2918,7 +2918,7 @@ fn init_lib_build_backend_maturin() -> Result<()> {
#[pyfunction]
fn hello_from_bin() -> String {
return "Hello from foo!".to_string();
"Hello from foo!".to_string()
}
/// A Python module implemented in Rust. The name of this function must match