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

Improve filter callback API redux #163

Merged
merged 9 commits into from
Mar 7, 2024

Conversation

FenrirWolf
Copy link
Member

@FenrirWolf FenrirWolf commented Feb 20, 2024

Now that our code is in control of calling the software keyboard, we can switch away from using CStrings in the filter callback without incurring extra allocations. Plus there's a lot of room to simplify the implementation overall, which I've been able to do here too.

@FenrirWolf FenrirWolf requested a review from a team as a code owner February 20, 2024 22:56
@FenrirWolf FenrirWolf force-pushed the improve_filter_callback branch 2 times, most recently from 806851d to 9ed5878 Compare February 21, 2024 20:24
Copy link
Member

@Meziu Meziu left a comment

Choose a reason for hiding this comment

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

LGTM! A great shaving of wrapper code around libctru thanks to an up-close implementation. The API feels much better now.

Copy link
Member

@ian-h-chamberlain ian-h-chamberlain left a comment

Choose a reason for hiding this comment

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

LGTM too!

Comment on lines +22 to +23
keyboard.set_filter_callback(Some(Box::new(move |str| {
if str.contains("boo") {
Copy link
Member

Choose a reason for hiding this comment

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

Huh, just realized I'm surprised there's no lint for shadowing builtin str, but I guess shadowing in general is not linted for so idk

ctru-rs/src/applets/swkbd.rs Show resolved Hide resolved
@FenrirWolf FenrirWolf merged commit c63932c into rust3ds:master Mar 7, 2024
4 checks passed
@FenrirWolf FenrirWolf deleted the improve_filter_callback branch March 7, 2024 08:00
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