Skip to content

Commit f9000a4

Browse files
committed
impl WriteBase32 for Vec<u5> show cannot fail
Use void::Void, which in uninhabited, to do this.
1 parent a565895 commit f9000a4

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ license = "MIT"
1414
strict = []
1515

1616
[dependencies]
17+
void = "1"

src/lib.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@
5151
#![deny(unused_mut)]
5252
#![cfg_attr(feature = "strict", deny(warnings))]
5353

54+
extern crate void;
55+
use void::Void;
56+
5457
use std::borrow::Cow;
5558
use std::{error, fmt};
5659

@@ -208,7 +211,7 @@ pub trait FromBase32: Sized {
208211
}
209212

210213
impl WriteBase32 for Vec<u5> {
211-
type Err = ();
214+
type Err = Void;
212215

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

0 commit comments

Comments
 (0)