Skip to content

Commit

Permalink
feat: use timestamp w/ tryfrom
Browse files Browse the repository at this point in the history
  • Loading branch information
EstebanBorai committed Jul 14, 2023
1 parent 38011df commit 815652e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/fluvio-smartmodule/benches/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fn bench_encode_smartmodule_encode(c: &mut Criterion) {
let wasm_bytes: Vec<u8> = read(EXAMPLE_WASM_FILE).unwrap();

c.bench_function("encode wasm file", |b| {
let smartmodule = SmartModuleInput::new(wasm_bytes.clone(), 0);
let smartmodule = SmartModuleInput::new(wasm_bytes.clone(), 0, 0);
let mut dest = vec![];

b.iter(|| {
Expand Down
5 changes: 2 additions & 3 deletions crates/fluvio-smartmodule/src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,10 @@ mod tests {

//when
let sm_input: SmartModuleInput =
SmartModuleInput::try_from_records(records, SMARTMODULE_BASE_TIMESTAMP)
.expect("records to input conversion failed");
SmartModuleInput::try_from(records).expect("records to input conversion failed");

let records_decoded: Vec<Record> = sm_input
.try_into_records(SMARTMODULE_BASE_TIMESTAMP)
.try_into()
.expect("input to records conversion failed");

//then
Expand Down

0 comments on commit 815652e

Please sign in to comment.