Implement 'Clone' for all URI types.

This commit is contained in:
Tal 2018-08-31 14:15:45 -07:00 committed by Sergio Benitez
parent 1da506ea5d
commit 8172f748b3
3 changed files with 4 additions and 4 deletions

View File

@ -21,7 +21,7 @@ use uri::{Authority, Origin, Error, as_utf8_unchecked};
///
/// The scheme part of the absolute URI and at least one of authority or origin
/// are required.
#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct Absolute<'a> {
source: Option<Cow<'a, str>>,
scheme: IndexedStr<'a>,

View File

@ -19,7 +19,7 @@ use uri::{as_utf8_unchecked, Error};
/// ```
///
/// Only the host part of the URI is required.
#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct Authority<'a> {
source: Option<Cow<'a, str>>,
user_info: Option<IndexedStr<'a>>,
@ -27,7 +27,7 @@ pub struct Authority<'a> {
port: Option<u16>,
}
#[derive(Debug)]
#[derive(Debug, Clone)]
crate enum Host<T> {
Bracketed(T),
Raw(T)

View File

@ -39,7 +39,7 @@ use uri::{Origin, Authority, Absolute, Error};
/// This type also provides the following percent encoding/decoding helper
/// methods: [`Uri::percent_encode`], [`Uri::percent_decode`], and
/// [`Uri::percent_decode_lossy`].
#[derive(Debug, PartialEq)]
#[derive(Debug, PartialEq, Clone)]
pub enum Uri<'a> {
/// An [`Origin`] URI.
Origin(Origin<'a>),