From 723afa317aa4404aa1d2745b9f9a8fa7c891e93d Mon Sep 17 00:00:00 2001 From: Sergio Benitez Date: Mon, 7 Jun 2021 19:38:19 -0700 Subject: [PATCH] Remove 'Copy' impl on 'Segments' iterator. This ideally prevents logic bugs where one thinks they've modified the iterator where, in reality, a new iterator has been returned. --- core/http/src/uri/segments.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/http/src/uri/segments.rs b/core/http/src/uri/segments.rs index f5402089..663d1d49 100644 --- a/core/http/src/uri/segments.rs +++ b/core/http/src/uri/segments.rs @@ -11,7 +11,7 @@ use crate::uri::error::PathError; /// [`Path::segments()`]: crate::uri::Path::segments() /// [`Query::segments()`]: crate::uri::Query::segments() /// -/// ### Examples +/// # Example /// /// ```rust /// # extern crate rocket; @@ -32,7 +32,7 @@ use crate::uri::error::PathError; /// # assert_eq!(uri.path().segments().count(), 4); /// # assert_eq!(uri.path().segments().next(), Some("a z")); /// ``` -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone)] pub struct Segments<'a, P: Part> { pub(super) source: &'a RawStr, pub(super) segments: &'a [P::Raw], @@ -276,7 +276,6 @@ macro_rules! impl_iterator { self.len() } } - ) }