Skip to content

Commit 1d78999

Browse files
committed
Fix messagepack test and make Json default codec
1 parent 9bfb777 commit 1d78999

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ pub use container::*;
1010
/// Supported input encoding.
1111
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, ValueEnum, Default)]
1212
pub enum Codec {
13+
#[default]
1314
/// JSON input.
1415
Json,
1516
/// Raw input, no validation, passed as-is.
16-
#[default]
1717
Raw,
1818
/// JSON input encoded as Messagepack.
1919
Messagepack,
11.6 KB
Binary file not shown.

tests/fixtures/messagepack-valid/src/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@ use std::io::{Read, Write};
33
fn main() {
44
let mut buf: Vec<u8> = vec![];
55
std::io::stdin().read_to_end(&mut buf).unwrap();
6+
let mut cursor = std::io::Cursor::new(&buf);
7+
rmpv::decode::read_value(&mut cursor).expect("Valid messagepack");
68
std::io::stdout().write_all(&buf).unwrap();
79
}

0 commit comments

Comments
 (0)