Skip to content

Commit 11973b7

Browse files
committed
Drop the rocket_04 feature
1 parent 35643be commit 11973b7

File tree

4 files changed

+2
-39
lines changed

4 files changed

+2
-39
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# 0.2.0 (unreleased)
22

33
* Bump MSRV to 1.35
4+
* Drop support for the `rocket_04` Cargo feature (Rocket 0.4 `FromFormValue` / `FromParam`
5+
implementations)
46

57
# 0.1.9
68

Cargo.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ repository = "https://git.sr.ht/~jplatte/js_int"
1010
keywords = ["integer", "no_std"]
1111
categories = ["no-std"]
1212

13-
[dependencies.rocket_04]
14-
package = "rocket"
15-
version = "0.4"
16-
optional = true
17-
1813
[dependencies.serde]
1914
version = "1.0"
2015
optional = true

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ fractional part is discarded. Please be aware that `serde_json` doesn't
4040
losslessly parse large floats with a fractional part by default (even if the
4141
fractional part is `.0`). To fix that, enable its `float_roundtrip` feature.
4242

43-
Deserialization of `Int` and `UInt` form values and path parameters for users
44-
of the Rocket web framework version 0.4 are supported via the `rocket_04`
45-
feature.
46-
4743
[travis]: https://travis-ci.org/jplatte/js_int
4844
[crates-io]: https://crates.io/crates/js_int
4945
[docs-rs]: https://docs.rs/js_int

src/lib.rs

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
//!
2626
//! # Features
2727
//!
28-
//! * `rocket_04`: Deserialization support from form values (`impl FromFormValue`) and path segments
29-
//! (`impl FromParam`) for users of the Rocket web framework version 0.4. Disabled by default.
3028
//! * `serde`: Serialization and deserialization support via [serde](https://serde.rs). Disabled by
3129
//! default. You can use `js_int` + `serde` in `#![no_std]` contexts if you use
3230
//! `default-features = false` for both.
@@ -52,31 +50,3 @@ pub use self::{
5250
int::{Int, MAX_SAFE_INT, MIN_SAFE_INT},
5351
uint::{UInt, MAX_SAFE_UINT},
5452
};
55-
56-
#[cfg(feature = "rocket_04")]
57-
macro_rules! rocket_04_impls {
58-
($type:ident) => {
59-
impl<'v> rocket_04::request::FromFormValue<'v> for $type {
60-
type Error = &'v rocket_04::http::RawStr;
61-
62-
fn from_form_value(
63-
form_value: &'v rocket_04::http::RawStr,
64-
) -> Result<Self, Self::Error> {
65-
form_value.parse::<$type>().map_err(|_| form_value)
66-
}
67-
}
68-
69-
impl<'r> rocket_04::request::FromParam<'r> for $type {
70-
type Error = &'r rocket_04::http::RawStr;
71-
72-
fn from_param(param: &'r rocket_04::http::RawStr) -> Result<Self, Self::Error> {
73-
param.parse::<$type>().map_err(|_| param)
74-
}
75-
}
76-
};
77-
}
78-
79-
#[cfg(feature = "rocket_04")]
80-
rocket_04_impls!(Int);
81-
#[cfg(feature = "rocket_04")]
82-
rocket_04_impls!(UInt);

0 commit comments

Comments
 (0)