Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add function to parse script from string#7

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Manishearth merged 4 commits intounicode-rs:masterfrompopzxc:parser-functions
Jun 28, 2021

Conversation

@popzxc
Copy link
Contributor

According to discussion inrust-lang/rust-clippy#7400

r?@Manishearth

#[inline]
pub(crate) fn inner_from_short_name(input: &str) -> Option<Self> {
match input {
"" => Some(Script::Unknown),
Copy link
Member

Choose a reason for hiding this comment

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

should this branch exist? Perhaps we should not return an Option and use Unknown as the catch all

Copy link
ContributorAuthor

@popzxcpopzxcJun 27, 2021
edited
Loading

Choose a reason for hiding this comment

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

I thinkOption may be helpful, because if some folk will accidentally usefrom_short_name instead offrom_full_namethey'll get aNone, which is easier to find early.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

However, I'm not insisting, if you think that it's better to not useOption here, I'll be happy to change the code.

Copy link
Member

Choose a reason for hiding this comment

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

I'm okay returning an Option but we shouldn't have the empty branch imo

popzxc reacted with thumbs up emoji
@ManishearthManishearth merged commitb0cda40 intounicode-rs:masterJun 28, 2021
@popzxcpopzxc deleted the parser-functions branchJune 28, 2021 14:27
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@ManishearthManishearthManishearth approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@popzxc@Manishearth

[8]ページ先頭

©2009-2025 Movatter.jp