Rocket

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit b87994b52c9781bbcdd072eeabd363023e7051ba
parent 4224419e63a99b1f21db447f8c4aedab8daec41a
Author: Alva Snædís <alva@alva.email>
Date:   Sat, 10 Nov 2018 16:37:31 +0000

Implement FromParam, FromFormValue for i128, u128.

Diffstat:
Mcore/lib/src/request/form/from_form_value.rs | 10++++++----
Mcore/lib/src/request/param.rs | 9+++++----
2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/core/lib/src/request/form/from_form_value.rs b/core/lib/src/request/form/from_form_value.rs @@ -77,8 +77,9 @@ use http::RawStr; /// Rocket implements `FromFormValue` for many standard library types. Their /// behavior is documented here. /// -/// * **f32, f64, isize, i8, i16, i32, i64, usize, u8, u16, u32, u64 -/// IpAddr, Ipv4Addr, Ipv6Addr, SocketAddrV4, SocketAddrV6, SocketAddr** +/// * **f32, f64, isize, i8, i16, i32, i64, i128, usize, u8, u16, u32, u64, +/// u128, IpAddr, Ipv4Addr, Ipv6Addr, SocketAddrV4, SocketAddrV6, +/// SocketAddr** /// /// A value is validated successfully if the `from_str` method for the given /// type returns successfully. Otherwise, the raw form value is returned as @@ -230,8 +231,9 @@ macro_rules! impl_with_fromstr { )+) } -impl_with_fromstr!(f32, f64, isize, i8, i16, i32, i64, usize, u8, u16, u32, u64, - IpAddr, Ipv4Addr, Ipv6Addr, SocketAddrV4, SocketAddrV6, SocketAddr); +impl_with_fromstr!(f32, f64, isize, i8, i16, i32, i64, i128, usize, u8, u16, + u32, u64, u128, IpAddr, Ipv4Addr, Ipv6Addr, SocketAddrV4, SocketAddrV6, + SocketAddr); impl<'v, T: FromFormValue<'v>> FromFormValue<'v> for Option<T> { type Error = !; diff --git a/core/lib/src/request/param.rs b/core/lib/src/request/param.rs @@ -72,8 +72,9 @@ use http::{RawStr, uri::{Segments, SegmentError}}; /// Rocket implements `FromParam` for several standard library types. Their /// behavior is documented here. /// -/// * **f32, f64, isize, i8, i16, i32, i64, usize, u8, u16, u32, u64, bool, -/// IpAddr, Ipv4Addr, Ipv6Addr, SocketAddrV4, SocketAddrV6, SocketAddr** +/// * **f32, f64, isize, i8, i16, i32, i64, i128, usize, u8, u16, u32, u64, +/// u128, bool, IpAddr, Ipv4Addr, Ipv6Addr, SocketAddrV4, SocketAddrV6, +/// SocketAddr** /// /// A value is parsed successfully if the `from_str` method from the given /// type returns successfully. Otherwise, the raw path segment is returned @@ -241,8 +242,8 @@ macro_rules! impl_with_fromstr { use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddrV4, SocketAddrV6, SocketAddr}; impl_with_fromstr! { - i8, i16, i32, i64, isize, u8, u16, u32, u64, usize, f32, f64, bool, - IpAddr, Ipv4Addr, Ipv6Addr, SocketAddrV4, SocketAddrV6, SocketAddr + i8, i16, i32, i64, i128, isize, u8, u16, u32, u64, u128, usize, f32, f64, + bool, IpAddr, Ipv4Addr, Ipv6Addr, SocketAddrV4, SocketAddrV6, SocketAddr } impl<'a, T: FromParam<'a>> FromParam<'a> for Result<T, T::Error> {