Shane F. Carr
Shane F. Carr
Some discussion: - @zbraniecki As I understand it, Option 3 is just sacrificing a bit of discoverability. I think discoverability is solved with documentation. Having less interplotted constructors makes it...
> CaseMapper doesn't have a Borrowed type and probably should? Yeah, probably. I don't see why it wouldn't. It has a default constructor with singleton data.
Example code for how to optionally load the locale data: ```rust if let Some(locale) = options.content_locale { let request = // ... match provider.load(request) { Ok(response) => { self.locale_specific_data =...
We should definitely have a test, if we don't already have one, that JSON data can be converted to Postcard and back and `PartialEq` works on the round-trip. I don't...
@robertbastian If we make the singleton functions not be const, then we can change them to call a fn to get a &'static reference to the singleton data, and the...
Good point. The data crate could export a `SingletonError` type which is `Infallible` if it contains baked and `DataError` if it contains postcard.
Yeah, code that wants to work both ways would need to use plain `.unwrap()`. I agree this isn't great for ergonomics. I would like to avoid having to feature-gate functions...
Real-world issues this solves: 1. Testing with JSON data, as justified in the OP. 2. Giving options in the tradeoff between compile time, run time, and binary size. 3. Allowing...
For singletons: I feel it would be in the cards to break our "never panic" policy to support this use case, which I think is an important use case but...
Shane/Rob discussion: - @sffc I listed out 3 use cases for this. - @robertbastian Compile time, sure. I don't think testing is important enough to impact API ergonomics. For global...