Skip to content

Commit

Permalink
Rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
sunli829 committed Mar 28, 2022
1 parent fd341bc commit a7aad2b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 7 additions & 5 deletions poem-openapi/src/payload/form.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
use std::ops::{Deref, DerefMut};

use poem::{Request, RequestBody, Result};
use poem::{
error::ParseFormError,
http::{header, HeaderValue, Method},
Request, RequestBody, Result,
};
use serde::de::DeserializeOwned;
use poem::error::ParseFormError;
use poem::http::{header, HeaderValue, Method};

use crate::{
payload::{ParsePayload, Payload},
Expand Down Expand Up @@ -50,8 +52,8 @@ impl<T: DeserializeOwned> ParsePayload for Form<T> {
let content_type = req.headers().get(header::CONTENT_TYPE);
if content_type
!= Some(&HeaderValue::from_static(
"application/x-www-form-urlencoded",
))
"application/x-www-form-urlencoded",
))
{
return match content_type.and_then(|value| value.to_str().ok()) {
Some(ty) => Err(ParseFormError::InvalidContentType(ty.to_string()).into()),
Expand Down
4 changes: 2 additions & 2 deletions poem-openapi/src/payload/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ mod attachment;
mod base64_payload;
mod binary;
mod event_stream;
mod form;
mod html;
mod json;
mod plain_text;
mod response;
mod form;

use poem::{Request, RequestBody, Result};

pub use self::{
attachment::Attachment, base64_payload::Base64, binary::Binary, event_stream::EventStream,
html::Html, json::Json, plain_text::PlainText, response::Response, form::Form,
form::Form, html::Html, json::Json, plain_text::PlainText, response::Response,
};
use crate::registry::{MetaSchemaRef, Registry};

Expand Down

0 comments on commit a7aad2b

Please sign in to comment.