torrust / torrust-index

This repository serves as the backend for the Torrust Index project.
https://torrust.com
GNU Affero General Public License v3.0
54 stars 19 forks source link

Clippy errors in nightly 1.83.0-nightly: `error: unneeded `return` statement` #741

Closed josecelano closed 1 month ago

josecelano commented 1 month ago

Relates to: https://rust-lang.github.io/rust-clippy/master/index.html#/needless_return

nightly-x86_64-unknown-linux-gnu (default) rustc 1.83.0-nightly (06bb8364a 2024-10-01)

error: unneeded `return` statement
   --> src/services/settings.rs:289:10
    |
289 |         );
    |          ^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
    |
289 ~         )assert_eq!(
290 +             extract_public_settings(&all_settings),
291 +             ConfigurationPublic {
292 +                 website_name: all_settings.website.name.clone(),
293 +                 tracker_url: all_settings.tracker.url,
294 +                 tracker_listed: all_settings.tracker.listed,
295 +                 tracker_private: all_settings.tracker.private,
296 +                 email_on_signup,
297 +                 website: all_settings.website.into(),
298 +             }
299 +         );
    |

It is complaining about #[tokio::test] using a semicolon in the last statement.

    #[tokio::test]
    async fn configuration_should_return_only_public_settings() {
        let for = "bar"; // <- this semicolon
    }
josecelano commented 1 month ago

This issue is being fixed here in the Tracker by @da2ce7