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

feat: make MultiFieldReview::show() return error on non-ASCII input strings #150

Closed

Conversation

dj8yfo
Copy link

@dj8yfo dj8yfo commented Mar 26, 2024

resolves #124
dependent pr : dj8yfo/app-near-rs#49
This variant is the most ergonomic one in terms of code changes required client-side among 3 variants attempted

@@ -714,7 +718,7 @@ impl<'a> Field<'a> {
.take(chunk_max_lines)
.enumerate()
{
chunks[1 + i] = Label::from(core::str::from_utf8(chunk).unwrap_or(""));
chunks[1 + i] = Label::from(core::str::from_utf8(chunk).unwrap());
Copy link
Author

@dj8yfo dj8yfo Mar 26, 2024

Choose a reason for hiding this comment

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

if assumption about ASCII-only self.name and self.value holds true, then core::str::from_utf8(...) isn't an Err for any slice of self.name and self.value

@dj8yfo dj8yfo marked this pull request as ready for review March 26, 2024 18:59
@dj8yfo dj8yfo closed this Jun 2, 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.

Suggestion: declare explicit support of ASCII-only charset at SDK level
1 participant