Skip to content
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

refactor!: Various api changes #20

Merged
merged 14 commits into from
Feb 4, 2023
Merged

refactor!: Various api changes #20

merged 14 commits into from
Feb 4, 2023

Conversation

ev3nvy
Copy link
Owner

@ev3nvy ev3nvy commented Feb 4, 2023

Miscellaneous breaking API changes. I don't expect to make any more breaking changes from now on, until 0.1.0 releases to the public.

Changes are focused mostly on two big things

  • TryFrom impl being used where it shouldn't have been
  • names/return types that suggest a function is fallible, although it could've neve failed.

There are also some fixes for clippy lints and a some changes to ManifestError. The changes to ManifestError object were necessary, because there were still some unwraps that couldn't be categorized.

Some unused dependencies were also removed.

ev3nvy added 14 commits February 4, 2023 07:07
All of them already had infallible implementations, yet were fallible.
Although the old name is more represenatative, the convention amongst
other crates seems to be to not name it `try_parse`. My guess why,
would be the fact that parsing anything is usually fallible.
They were already infallible so renaming them now represents that.
Strictly speaking, `TryFrom` is used for conversion between different
types, yet it is used here for parsing.
Same change as the previous commit. `TryFrom` is normally used to
implement conversion between types, yet was used for parsing here.

`try_from_path` also got renamed to `from_path` because nothing else is
prefixed with `try_`.
Should've been there from the start but was overlooked. :^)
It's now exported from the main crate directly.
A bit less code this way.
`ReadFileError` was a very specific error that could be combined into
another error given a name change, so it got removed.

`ReadBytesError` got renamed into `IoError`. This means that it can
also be used when writing files fails (needed for downloading files).

`FileParseError` got added. This one will be thrown instead of the two
panics that were previously present in `File`.

`FlatbufferError` now contains `InvalidFlatbufferError` instead of io
error.
Welp, I was still on a previous version so my clippy missed this one.
@ev3nvy ev3nvy added status: completed Issue was resolved, or pull request was merged type: refactor Issue or pull request related to code refactoring labels Feb 4, 2023
@ev3nvy ev3nvy added this to the v0.1.0 milestone Feb 4, 2023
@ev3nvy ev3nvy merged commit e1980d7 into develop Feb 4, 2023
@ev3nvy ev3nvy deleted the api-changes branch February 4, 2023 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: completed Issue was resolved, or pull request was merged type: refactor Issue or pull request related to code refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant