Our great sponsors
-
In a previous PR to clippy, an suggestion from the maintainers (@flip1995) came up to create a lint detecting passing an owned string to something expecting where "" would be accepted. I want to follow up on this and open an issue (and perhaps a PR) to implement this, but first I want to make sure I'm not missing anything.
-
There are ways to enforce it, for example declaring the variable const or static, or using the nightly feature inline_const: https://github.com/rust-lang/rust/issues/76001 which would allow you to write let s = const { String::new() };, ensuring that everything from inside the const block is evaluated at compile time.
-
SonarQube
Static code analysis for 29 languages.. Your projects are multi-language. So is SonarQube analysis. Find Bugs, Vulnerabilities, Security Hotspots, and Code Smells so you can release quality code every time. Get started analyzing your projects today for free.