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

Replace is_some_and with map_or for MSRV #5

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

DanGould
Copy link

@DanGould DanGould commented Dec 2, 2024

is_some_and is stable only in Rust 1.70.0 and greater.

  • map_or(false, |s| s.eq_ignore_ascii_case(SCHEME)):
    • This method is used to handle the Option returned by get().
    • If get() returns None (i.e., the string is too short), map_or() returns false.
    • If get() returns Some(s), it applies the closure |s| s.eq_ignore_ascii_case(SCHEME).
      • This closure checks if the substring s is equal to SCHEME, ignoring ASCII case differences.
      • If they are equal, it returns true; otherwise, it returns false.

@DanGould DanGould requested a review from nothingmuch December 2, 2024 18:31
is_some_and is stable only in Rust 1.70.0 and greater.

map_or(false, |s| s.eq_ignore_ascii_case(SCHEME)):
  - This method is used to handle the Option returned by get().
  - If get() returns None (i.e., the string is too short), map_or()
    returns false.
  - If get() returns Some(s), it applies the closure
    |s| s.eq_ignore_ascii_case(SCHEME).
     - This closure checks if the substring s is equal to SCHEME,
       ignoring ASCII case differences.
     - If they are equal, it returns true; otherwise, it returns
       false.
@DanGould DanGould merged commit e5a2c87 into payjoin:master Dec 2, 2024
@DanGould
Copy link
Author

DanGould commented Dec 2, 2024

Confirmed passes in CI by #1's 1.63.0 run

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.

1 participant