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

[optimize]: remove the return value option #46

Open
fansehep opened this issue Oct 16, 2023 · 2 comments
Open

[optimize]: remove the return value option #46

fansehep opened this issue Oct 16, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@fansehep
Copy link
Collaborator

fansehep commented Oct 16, 2023

shaun-rs/src/parser/mod.rs

Lines 1226 to 1231 in 7974f22

fn parse_expression(&mut self, precedence: Precedence) -> Result<Option<Expression>> {
if !is_prefix_oper(&self.pre_token) {
return Err(Error::ParseErr(fmt_err!(
"No prefixOperatorFunc for: {:?}",
&self.pre_token
)));

Now in parse_expression function, it's return value type is Result<Option<Expression>>, but in fact, we will not return None, So use Option is redundant.

remove the Option, and change other place which use this function.

@fansehep fansehep added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Oct 16, 2023
@apengn
Copy link
Contributor

apengn commented Oct 16, 2023

Can you assign it to me?

@fansehep
Copy link
Collaborator Author

Can you assign it to me?

sure!Really thanks for you. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants