Skip to content

What E to use in stubs for Result<T, E>? #444

@petertseng

Description

@petertseng

In #269 we decided that exercises should have stubs. In #371 we further decided that the provided stubs should compile.

For all exercises that have function(s) expecting a Result<T, E>, this poses a question: What type should go in the stub for E?

I'm starting to shy away from using str as an error type since it is difficult to programmatically inspect, but now need to think about which of the other options I prefer. Perhaps my reason is bogus and using str is okay (let me know!). A contributor once also said this as a tip, but did not provide reasoning, so I cannot evaluate the tip. #259 (comment)

Need to think about the goals: Are we trying to teach something via these stubs? Or is it precisely the minimum code needed to get it to compile?

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