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

lib: add try_take! macro, handling AlreadyUsed Options #360

Merged
merged 1 commit into from
Nov 16, 2023

Commits on Nov 16, 2023

  1. lib: add try_take! macro, handling AlreadyUsed Options

    In several places we represent something that could be consumed as an
    `Option<T>`. When we try to use it, we `take()` the option, match the
    result, and return `rustls_result::AlreadyUsed` if `take()` returned
    `None`.
    
    Since this pattern is becoming more common with the use of more builder
    patterns this commit adds a `try_take!` macro that can do this
    repetitive work for us.
    cpu committed Nov 16, 2023
    Configuration menu
    Copy the full SHA
    8c557c2 View commit details
    Browse the repository at this point in the history