Merge, re-group imports in urlencoded

This commit is contained in:
Jonas Platte 2020-05-14 22:08:55 +02:00
parent 981a3aebe2
commit e55527fee6
No known key found for this signature in database
GPG Key ID: 7D261D771D915378
3 changed files with 16 additions and 17 deletions

View File

@ -5,13 +5,12 @@ mod pair;
mod part; mod part;
mod value; mod value;
use std::{borrow::Cow, error, fmt, str};
use serde::ser; use serde::ser;
use std::borrow::Cow; use url::form_urlencoded::{
use std::error; Serializer as UrlEncodedSerializer, Target as UrlEncodedTarget,
use std::fmt; };
use std::str;
use url::form_urlencoded::Serializer as UrlEncodedSerializer;
use url::form_urlencoded::Target as UrlEncodedTarget;
/// Serializes a value into a `application/x-www-form-urlencoded` `String` buffer. /// Serializes a value into a `application/x-www-form-urlencoded` `String` buffer.
/// ///

View File

@ -1,7 +1,8 @@
use super::{part::Sink, Error}; use std::{borrow::Cow, ops::Deref};
use serde::Serialize; use serde::Serialize;
use std::borrow::Cow;
use std::ops::Deref; use super::{part::Sink, Error};
pub enum Key<'key> { pub enum Key<'key> {
Static(&'static str), Static(&'static str),

View File

@ -1,12 +1,11 @@
use super::key::KeySink; use std::{borrow::Cow, mem};
use super::part::PartSerializer;
use super::value::ValueSink;
use super::Error;
use serde::ser; use serde::ser;
use std::borrow::Cow; use url::form_urlencoded::{
use std::mem; Serializer as UrlEncodedSerializer, Target as UrlEncodedTarget,
use url::form_urlencoded::Serializer as UrlEncodedSerializer; };
use url::form_urlencoded::Target as UrlEncodedTarget;
use super::{key::KeySink, part::PartSerializer, value::ValueSink, Error};
pub struct PairSerializer<'input, 'target, Target: 'target + UrlEncodedTarget> { pub struct PairSerializer<'input, 'target, Target: 'target + UrlEncodedTarget> {
urlencoder: &'target mut UrlEncodedSerializer<'input, Target>, urlencoder: &'target mut UrlEncodedSerializer<'input, Target>,