From 12302bcadb726ced8f60a02f75e5a28475b5a097 Mon Sep 17 00:00:00 2001 From: Sergio Benitez Date: Fri, 23 Dec 2016 02:39:34 -0800 Subject: [PATCH] Document default FromParam impls. --- lib/src/request/param.rs | 9 +++++++++ lib/src/testing.rs | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/src/request/param.rs b/lib/src/request/param.rs index 524cc606..da85f3b6 100644 --- a/lib/src/request/param.rs +++ b/lib/src/request/param.rs @@ -254,6 +254,15 @@ impl<'a, T: FromParam<'a>> FromParam<'a> for Option { /// the matched segments (via the /// [Segments](/rocket/http/uri/struct.Segments.html) iterator) into the /// implementing type. +/// +/// # Provided Implementations +/// +/// Rocket implements `FromParam` for `PathBuf`. The `PathBuf` implementation +/// constructs a path from the segments iterator. Each segment is +/// percent-decoded. If a segment equals ".." before or after decoding, the +/// previous segment (if any) is omitted. For security purposes, any other +/// segments that begin with "*" or "." are ignored. If a percent-decoded +/// segment results in invalid UTF8, an `Err` is returned with the `Utf8Error`. pub trait FromSegments<'a>: Sized { /// The associated error to be returned when parsing fails. type Error: Debug; diff --git a/lib/src/testing.rs b/lib/src/testing.rs index 157813af..1fb55d66 100644 --- a/lib/src/testing.rs +++ b/lib/src/testing.rs @@ -32,7 +32,7 @@ //! //! The testing methadology is simple: //! -//! 1. Construct a `Rocket` instance +//! 1. Construct a `Rocket` instance. //! 2. Construct a request. //! 3. Dispatch the request using the Rocket instance. //! 4. Inspect, validate, and verify the response.