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 expect with a safer alternative that returns None instead #240

Merged
merged 1 commit into from
Apr 5, 2024

Commits on Mar 26, 2024

  1. Replace expect with a safer alternative that returns None instead

    Given the fact that this function returns a `Result`, in case of a
    failure, the function should either return an `Err` or silent fail.
    
    When using `expect`, the program just panics, so none of the above
    situations happen.
    
    I have replaced `expect` with `and_then`. Now the code silent fails
    in case time before UNIX epoch is not supported, returning `None` instead.
    
    Signed-off-by: Costin-Robert Sin <sin.costinrobert@gmail.com>
    costinsin committed Mar 26, 2024
    Configuration menu
    Copy the full SHA
    73dab7b View commit details
    Browse the repository at this point in the history