8000 hongbo/align rust option by bobzhang · Pull Request #2381 · moonbitlang/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

hongbo/align rust option #2381

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

Merged
merged 1 commit into from
Jun 29, 2025
Merged

hongbo/align rust option #2381

merged 1 commit into from
Jun 29, 2025

Conversation

bobzhang
Copy link
Contributor

Copy link
peter-jerry-ye-code-review bot commented Jun 29, 2025
Inconsistent type annotation format in test code

Category
Correctness
Code Snippet
Line 225: assert_eq(None.unwrap_or_else(() => 5), 5)
Recommendation
Use consistent type annotation: assert_eq((None : Int?).unwrap_or_else(() => 5), 5)
Reasoning
The test should maintain consistency with other similar assertions that explicitly specify the type (None : Int?) for clarity and to match the pattern used in other test cases

Minor style inconsistency in spacing around type annotations

Category
Maintainability
Code Snippet
Lines in README: let none : Int? = None vs let value = none.unwrap_or_else(() => 0)
Recommendation
Consistently use spacing around colons in type annotations throughout the documentation examples
Reasoning
Code style should be consistent within documentation examples to maintain readability and provide a good example for users

Redundant lambda syntax in documentation examples

Category
Maintainability
Code Snippet
Line 63: let new_some = some.map((value : Int) => value + 1)
Recommendation
Consider simplifying to let new_some = some.map(fn(value) { value + 1 }) if that's the preferred MoonBit style, or keep consistent with the existing pattern
Reasoning
The lambda syntax change from () => { 0 } to () => 0 suggests a preference for concise lambda expressions, so the map example should follow the same pattern for consistency

@bobzhang bobzhang force-pushed the hongbo/align_rust_option branch from f648497 to 0626b84 Compare June 29, 2025 12:39
@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 142

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 89.361%

Totals Coverage Status
Change from base Build 138: 0.0%
Covered Lines: 3452
Relevant Lines: 3863

💛 - Coveralls

@bobzhang bobzhang merged commit 4a12485 into main Jun 29, 2025
10 checks passed
@bobzhang bobzhang deleted the hongbo/align_rust_option branch June 29, 2025 13:39
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.

2 participants
0