Skip to content

Commit

Permalink
impl WriteBase32 for Vec<u5> show cannot fail
Browse files Browse the repository at this point in the history
Use void::Void, which in uninhabited, to do this.
  • Loading branch information
Ericson2314 committed Sep 23, 2022
1 parent ae9f18a commit cc50e7d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ use alloc::borrow::Cow;
#[cfg(any(feature = "std", test))]
use std::borrow::Cow;

use core::{fmt, mem};
use core::{convert::Infallible, fmt, mem};

/// Integer in the range `0..32`
#[derive(PartialEq, Eq, Debug, Copy, Clone, Default, PartialOrd, Ord, Hash)]
Expand Down Expand Up @@ -232,7 +232,7 @@ pub trait FromBase32: Sized {
}

impl WriteBase32 for Vec<u5> {
type Err = ();
type Err = Infallible;

fn write(&mut self, data: &[u5]) -> Result<(), Self::Err> {
self.extend_from_slice(data);
Expand Down

0 comments on commit cc50e7d

Please sign in to comment.