mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-27 00:00:24 +02:00
#[must_use] all the things! (#1809)
This commit is contained in:
@@ -46,6 +46,7 @@ pin_project! {
|
||||
/// ```
|
||||
#[cfg(feature = "async-read-body")]
|
||||
#[derive(Debug)]
|
||||
#[must_use]
|
||||
pub struct AsyncReadBody<R> {
|
||||
#[pin]
|
||||
read: StreamBody<ReaderStream<R>>,
|
||||
|
||||
@@ -108,6 +108,7 @@ use tower_service::Service;
|
||||
///
|
||||
/// See the [module docs](self) for examples.
|
||||
#[derive(Debug, Clone)]
|
||||
#[must_use]
|
||||
pub enum Either<E1, E2> {
|
||||
#[allow(missing_docs)]
|
||||
E1(E1),
|
||||
@@ -119,6 +120,7 @@ pub enum Either<E1, E2> {
|
||||
///
|
||||
/// See the [module docs](self) for examples.
|
||||
#[derive(Debug, Clone)]
|
||||
#[must_use]
|
||||
pub enum Either3<E1, E2, E3> {
|
||||
#[allow(missing_docs)]
|
||||
E1(E1),
|
||||
@@ -132,6 +134,7 @@ pub enum Either3<E1, E2, E3> {
|
||||
///
|
||||
/// See the [module docs](self) for examples.
|
||||
#[derive(Debug, Clone)]
|
||||
#[must_use]
|
||||
pub enum Either4<E1, E2, E3, E4> {
|
||||
#[allow(missing_docs)]
|
||||
E1(E1),
|
||||
@@ -147,6 +150,7 @@ pub enum Either4<E1, E2, E3, E4> {
|
||||
///
|
||||
/// See the [module docs](self) for examples.
|
||||
#[derive(Debug, Clone)]
|
||||
#[must_use]
|
||||
pub enum Either5<E1, E2, E3, E4, E5> {
|
||||
#[allow(missing_docs)]
|
||||
E1(E1),
|
||||
@@ -164,6 +168,7 @@ pub enum Either5<E1, E2, E3, E4, E5> {
|
||||
///
|
||||
/// See the [module docs](self) for examples.
|
||||
#[derive(Debug, Clone)]
|
||||
#[must_use]
|
||||
pub enum Either6<E1, E2, E3, E4, E5, E6> {
|
||||
#[allow(missing_docs)]
|
||||
E1(E1),
|
||||
@@ -183,6 +188,7 @@ pub enum Either6<E1, E2, E3, E4, E5, E6> {
|
||||
///
|
||||
/// See the [module docs](self) for examples.
|
||||
#[derive(Debug, Clone)]
|
||||
#[must_use]
|
||||
pub enum Either7<E1, E2, E3, E4, E5, E6, E7> {
|
||||
#[allow(missing_docs)]
|
||||
E1(E1),
|
||||
@@ -204,6 +210,7 @@ pub enum Either7<E1, E2, E3, E4, E5, E6, E7> {
|
||||
///
|
||||
/// See the [module docs](self) for examples.
|
||||
#[derive(Debug, Clone)]
|
||||
#[must_use]
|
||||
pub enum Either8<E1, E2, E3, E4, E5, E6, E7, E8> {
|
||||
#[allow(missing_docs)]
|
||||
E1(E1),
|
||||
|
||||
@@ -58,6 +58,7 @@ pin_project! {
|
||||
/// ```
|
||||
// we use `AsExtractor` as the default because you're more likely to name this type if its used
|
||||
// as an extractor
|
||||
#[must_use]
|
||||
pub struct JsonLines<S, T = AsExtractor> {
|
||||
#[pin]
|
||||
inner: Inner<S>,
|
||||
|
||||
@@ -94,6 +94,7 @@ use std::ops::{Deref, DerefMut};
|
||||
/// ```
|
||||
#[derive(Debug, Clone, Copy, Default)]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "protobuf")))]
|
||||
#[must_use]
|
||||
pub struct Protobuf<T>(pub T);
|
||||
|
||||
#[async_trait]
|
||||
|
||||
@@ -30,6 +30,7 @@ use serde::Serialize;
|
||||
/// ```
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "erased-json")))]
|
||||
#[derive(Debug)]
|
||||
#[must_use]
|
||||
pub struct ErasedJson(serde_json::Result<Bytes>);
|
||||
|
||||
impl ErasedJson {
|
||||
|
||||
@@ -33,6 +33,7 @@ use axum::{
|
||||
/// # let _: Router = app;
|
||||
/// ```
|
||||
#[derive(Debug)]
|
||||
#[must_use]
|
||||
pub struct Resource<S = (), B = Body> {
|
||||
pub(crate) name: String,
|
||||
pub(crate) router: Router<S, B>,
|
||||
|
||||
Reference in New Issue
Block a user