-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gondolyr request list #2
Comments
Could you please describe what feels clunky about it? |
In the following example, let manga = client
.manga()
.aggregate()
.manga_id(&manga_id)
.translated_language(languages)
.build()
.unwrap()
.send()
.await; The |
Instead of validating during But to my knowledge an unwrap is needed somewhere in there, how would you otherwise let the user know something is wrong? |
The link to burntsushi's comment does not work anymore so here's an alternative: https://red.artemislena.eu/r/rust/comments/gj8inf/rust_structuring_and_handling_errors_in_2020/fqlmknt/?context=3 For convenience, I have copied the content here in case the new link goes down as well. u/burntsushi May 14 '20
|
I have a bunch of stuff 😅 ...
There are probably more I can list but this is already a lot.
anyhow
andthiserror
can be replaced with an error type that is manually implemented rather than derived. See burntsushi's comment https://libreddit.spike.codes/r/rust/comments/gj8inf/rust_structuring_and_handling_errors_in_2020/fqlmknt/?context=3 for some guidelines.derive-builder
can easily be done manually and would be good to remove.Owner Edit: This syntax doesn't work since v3
So the following example should be:
Owner Edit : It won't work since the old login system is deprecated
mangadex-api-types
,mangadex-api-schema
) was worth the trouble. It might be good to put them back into a single workspace but I can't say which is better honestly.v5
module is probably unnecessary. I made it because of the potential of future major API versions since at the time I made it, there was av2
andv5
of the MangaDex API.String
fields converted to an enum type where appropriate. Here is one example:mangadex-api/mangadex-api-schema/src/v5/check_token_response.rs
Line 7 in a4da7a1
Notes about some of the custom deserialization I added:
language_array_or_skip_null
exists because there are some manga that havenull
in theavailableTranslatedLanguages
field. (Example manga: https://api.mangadex.org/manga/a96676e5-8ae2-425e-b549-7f15dd34a6d8)localizedstring_array_or_map
used to be necessary for the.data.attributes.description
field of https://api.mangadex.org/manga/fe38c4c2-8cea-4f91-9e80-b368172bdd5c but it looks like that has been fixed.volume_aggregate_array_or_map
fixes an issue with some manga aggregate results where the.volumes.0.chapters
field would be an array instead of an object. For example, https://api.mangadex.org/manga/d773c8be-8e82-4ff1-a4e9-46171395319b/aggregate. This one has "none" as a key within.volumes
: https://api.mangadex.org/manga/14e157c3-7856-4f86-a2d2-8faa86660744/aggregateOriginally posted by @gondolyr in #1 (comment)
The text was updated successfully, but these errors were encountered: