Skip to content

Error handling: Result vs panic #8

@dhardy

Description

@dhardy

The consensus on this seems to be that Result is better in general, but there is little point for the simple next_u* functions, resulting in the following members of Rng or similar traits

    fn next_u32(&mut self) -> u32;
    // other next_u* ...

    fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error>;

    // possibly also a panicing fill function:
    fn fill_bytes(&mut self, dest: &mut [u8]);

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions