Skip to content

[rust] simplify clear_metadata() body#11862

Merged
diemol merged 4 commits intoSeleniumHQ:trunkfrom
iampopovich:clear-metadata-simplify
Apr 5, 2023
Merged

[rust] simplify clear_metadata() body#11862
diemol merged 4 commits intoSeleniumHQ:trunkfrom
iampopovich:clear-metadata-simplify

Conversation

@iampopovich
Copy link
Copy Markdown
Contributor

Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it

Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.

Description

This version of the code uses the ? operator to propagate any error that occurs during the call to fs::remove_file. If an error occurs, it will return an Err variant with the error value, which will be logged as a warning message by the caller. If the file is successfully deleted, it logs a trace message and returns Ok(()).

Motivation and Context

to make code more simple to read without changing its safety

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@diemol diemol requested a review from bonigarcia April 5, 2023 08:58
Copy link
Copy Markdown
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

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

Thank you, @iampopovich!

@diemol diemol merged commit 42632b4 into SeleniumHQ:trunk Apr 5, 2023
yashcho pushed a commit to yashcho/selenium that referenced this pull request Apr 7, 2023
simplify clear_metadata() body

Co-authored-by: Diego Molina <[email protected]>
@iampopovich iampopovich deleted the clear-metadata-simplify branch April 30, 2023 20:13
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