Skip to content

Commit bcad2d4

Browse files
committed
Add FromSkyhashBytes impl for Vec<u8>
1 parent 901e9ea commit bcad2d4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/types.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,16 @@ impl FromSkyhashBytes for Vec<String> {
521521
}
522522
}
523523

524+
impl FromSkyhashBytes for Vec<u8> {
525+
fn from_element(element: Element) -> SkyResult<Self> {
526+
match element {
527+
Element::String(s) => Ok(s.into_bytes()),
528+
Element::Binstr(b) => Ok(b),
529+
_ => Err(Error::ParseError(BAD_ELEMENT.to_owned())),
530+
}
531+
}
532+
}
533+
524534
impl FromSkyhashBytes for Vec<Vec<u8>> {
525535
fn from_element(e: Element) -> SkyResult<Self> {
526536
let e = match e {

0 commit comments

Comments
 (0)