Add #[must_use] to types and methods (#3395)

Co-authored-by: Theodore Bjernhed <[email protected]>
This commit is contained in:
Theodore Bjernhed
2025-07-05 19:07:24 +02:00
committed by GitHub
co-authored by Theodore Bjernhed
parent d7104313cb
commit fb64e72de9
22 changed files with 59 additions and 6 deletions
+2
View File
@@ -28,6 +28,7 @@ pub use self::typed::{SecondElementIs, TypedPath};
// Validates a path at compile time, used with the vpath macro.
#[rustversion::since(1.80)]
#[doc(hidden)]
#[must_use]
pub const fn __private_validate_static_path(path: &'static str) -> &'static str {
if path.is_empty() {
panic!("Paths must start with a `/`. Use \"/\" for root routes")
@@ -76,6 +77,7 @@ macro_rules! vpath {
}
/// Extension trait that adds additional methods to [`Router`].
#[allow(clippy::return_self_not_must_use)]
pub trait RouterExt<S>: sealed::Sealed {
/// Add a typed `GET` route to the router.
///