Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.
This repository was archived by the owner on Feb 18, 2025. It is now read-only.

Add better descriptions as to what causes None to be returned.  #44

Open

Description

@Peter-Lande

Currently the documentation is vague about what causes None returns in functions. It would be very helpful to be able to not have to comb through the code to implement the api calls and know what is happening if None is returned.

Activity

  1. opeolluwa commented on Apr 1, 2023

    @opeolluwa

    Regards this, could you provide more information on the nature of what is to be returned

  2. opeolluwa commented on Apr 1, 2023

    @opeolluwa

    If you indulge me, I could return a struct, which will contain the PathBuf if any, and an error message if none

  3. soc commented on Apr 1, 2023

    @soc
    Collaborator

    Like a Result?

  4. opeolluwa commented on Apr 1, 2023

    @opeolluwa

    A result that returns the Ok(Pathbuf) or an Err(Strong)

  5. Peter-Lande commented on Apr 1, 2023

    @Peter-Lande
    Author

    Yeah I think that is a better solution that the current Some/None strategy. Having some way to understand what failed to happen is better than it failing with no context. I am not entirely sure what the original context was of this issue, let me review the code I used that faced this issue and get back to you.

  6. opeolluwa commented on Apr 1, 2023

    @opeolluwa

    I looked it up, I think it's coming from the dir-sys crate

  7. soc commented on Apr 1, 2023

    @soc
    Collaborator

    The main concern when I thought about this pre-1.0 was that the errors that may show up in the failure case are hard to predict/test/standardize across platforms.

  8. opeolluwa commented on Apr 1, 2023

    @opeolluwa

    Hmmm 🤔

  9. opeolluwa commented on Apr 1, 2023

    @opeolluwa

    Now, the challenge is getting the error cause, which would be better than a generic message I suggested earlier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions