Edgar Onghena

Results 45 comments of Edgar Onghena

The Rust standard library is supposed to be small in order not to be tempted to introduce non-backward-compatible changes. You will probably never see a struct named `Json` in an...

Please provide a minimal example, it will be much easier to help you. Especially since your test references an external file that we don't have.

Serde's enum variant serializers rely on strings[^1] and there's no way around that without modifying serde_json[^2] in your case. You will probably have to implement the (de)serialization of `Block` yourself...

```rs #[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] struct Crate { package: Package, //etc } #[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] struct Package { name: String, } ```

> Why is this? Probably because `&'static str` is `Copy + Send + Sync + 'static` and `#[no_std]`-compatible, which makes it much more convenient to work with. Removing it now...

Ohh OK I see yeah. I sorta guessed this but the fact that you called this a dynamic **_`enum`_** type confused me (don't worry it's fine). The default `enum` serializer...

Wouldn't an integer type be better for monetary values? If you store your prices in cents, you'll have the best precision and speed possible. However, if you're dealing with sub-cent...

You can create a newtype around `PrimitiveDateTime` or `DateTime`, the one you prefer the most, and manually implement both of these traits yourself. Or you simply use both and do...

Rocket doesn't let you put guard arguments on error catchers because that would make them faillible/forwardable too... but they're supposed to catch all errors. However, if you look at the...

From my understanding, the doc comment is wrong, responders aren't meant to be async. It's the `Handler`'s job to do any async calculation prior to returning the `Responder`. In can't...