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

Replace show image crate #55

Merged
merged 23 commits into from
Oct 18, 2023
Merged

Replace show image crate #55

merged 23 commits into from
Oct 18, 2023

Conversation

ashbeitz
Copy link
Contributor

@ashbeitz ashbeitz commented Oct 18, 2023

The show-image crate used an OSS license that we did not want to use. This fix moved us over to the sdl2 create, which uses OSS license that we are happy to use.

@github-actions
Copy link
Contributor

Alex Recommends Report

Alex recommends the following language changes, but Alex is a regular expression based algorithm, so take them with a grain of salt.

✨ 🚀 ✨ Nothing to Report ✨ 🚀 ✨

.github/workflows/rust-ci.yml Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
window_title: &str,
window_width: u32,
window_height: u32,
) -> Result<WindowCanvas, String> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for rust libraries it's generally not recommended to use strings for the error type. this makes it hard to do anything but log the error. I think other places in Ibeji are using Status (e.g. here) so ideally we should use that here too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used String to be consistent with the sdl2 crate's methods, which use String.

Status comes from the tonic crate and is currently only used in conjunction with gRPC-related calls.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used String to be consistent with the sdl2 crate's methods, which use String.

Converting errors can be done with map_err. It's also worth mentioning that the library owner would prefer to use a proper error type but hasn't made the change due to concerns with breaking changes: Rust-SDL2/rust-sdl2#1053

Status comes from the tonic crate and is currently only used in conjunction with gRPC-related calls.

Then Status wouldn't be the right thing to use, we should find something else. Consider defining your own error type similar to what Freyja does, or you could use anyhow (not recommended for libraries but easy to use and better than String) or thiserror, or even reuse std::io::Error

jorchiu
jorchiu previously approved these changes Oct 18, 2023
jorchiu
jorchiu previously approved these changes Oct 18, 2023
@ashbeitz ashbeitz merged commit 6315c61 into main Oct 18, 2023
11 of 13 checks passed
@ashbeitz ashbeitz deleted the ashbeitz/replaceShowImageCrate branch October 18, 2023 23:59
mobicatk pushed a commit to Mobica/EclipseSDV_ibeji that referenced this pull request Apr 24, 2024
* Replace show-image crate

* Replace show-image crate

* Replace show-image crate

* Replace show-image crate

* Replace show-image crate

* Replace show-image crate

* Replace show-image crate

* Replace show-image crate

* Replace show-image crate

* Replace show-image crate

* Replace show-image crate

* Replace show-image crate

* Replace show-image crate

* Replace show-image crate

* Replace show-image crate

* Replace show-image crate

* Replace show-image crate

* Replace show-image crate

* Replace show-image crate

* Replace show-image crate

* Replace show-image crate

* Replace show-image crate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants