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

Update edition3/03/index.md #1272

Closed
wants to merge 1 commit into from
Closed

Update edition3/03/index.md #1272

wants to merge 1 commit into from

Conversation

xuanplus
Copy link

enable it to print "Hello Rust!" on qemu:

屏幕截图(1)

I find that I can't use runtime values inside the pattern, I can only match on a range made of compile-time constants.

Therefore, I add the function in_range to judge it.

The Point from embedded_graphics can't use try_into? So I add a From to change it to Position.

The impl OriginDimensions is from example of embedded_graphics official:

This trait should be implemented instead of Dimensions if the top left corner of the bounding box will always be at the origin, which will be the case for most display drivers. Some types, like [ImageDrawable], require a bounding box that starts at the origin and can only be used if OriginDimensions is implemented.

Anyway, now, It works.

enable it to print "Hello Rust!" on qemu
@phil-opp
Copy link
Owner

phil-opp commented Feb 8, 2024

Thanks for submitting this! I will probably not merge this directly, but I will definitely consider it when I write the rest of this post.

@xuanplus xuanplus closed this by deleting the head repository Jul 8, 2024
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.

2 participants