From cc50e7d509f2887020a753a42b9eaba8907eac3b Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 11 Mar 2020 18:40:58 -0400 Subject: [PATCH] `impl WriteBase32 for Vec` show cannot fail Use void::Void, which in uninhabited, to do this. --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 1154f5a3..cdb70f54 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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)] @@ -232,7 +232,7 @@ pub trait FromBase32: Sized { } impl WriteBase32 for Vec { - type Err = (); + type Err = Infallible; fn write(&mut self, data: &[u5]) -> Result<(), Self::Err> { self.extend_from_slice(data);