This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::fmt; | |
use actix_http::{Response, Error}; | |
use actix_web::{HttpRequest, Responder}; | |
use actix_web::http::StatusCode; | |
use futures::future::{err, ok, Ready}; | |
use paperclip::v2::schema::Apiv2Schema; | |
use paperclip::actix::OperationModifier; | |
use paperclip::v2::models::{Response as PaperclipResponse, Either, DefaultOperationRaw, DefaultSchemaRaw}; | |
use serde::Serialize; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Use for pattern matching on arrays where you don't care about the order of the items. | |
/// About the simplest case would be where you have 2 options and need exactly one to be `Some`: | |
/// ``` | |
/// let input = [Some(42), None]; | |
/// if let permute!([Some(n)], [None]) = input { | |
/// assert_eq!(n, 42); | |
/// } | |
/// ``` | |
/// In this case it matches just like `[Some(n), None] | [None, Some(n)]`, but for more pattern groups it could save a lot more code. | |
/// The parameters are some number of (comma-separated, square-bracket-enclosed) groups of comma-separated patterns, each group should contain patterns which would match the same inputs, as the ordering of these doesn't need to be permuted. |
OlderNewer