Skip to content

Commit

Permalink
rename decode_trace to encode_trace
Browse files Browse the repository at this point in the history
I was cofused with the decode / encode distinction, which was rightly
pointed out by @jakobgetz. Correcting this.
  • Loading branch information
doehyunbaek committed Jan 9, 2024
1 parent 4234bc3 commit 652430d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions crates/replay_gen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ mod tests {

use crate::{
codegen::generate_javascript, irgen::IRGenerator, opt::merge_fn_results,
trace::decode_trace,
trace::encode_trace,
};

#[test]
fn trace_encode_decode_same() -> std::io::Result<()> {
fn trace_decode_encode_same() -> std::io::Result<()> {
use super::*;
use std::fs;
use std::io;
Expand Down Expand Up @@ -53,10 +53,10 @@ mod tests {
trace.push(event);
}
let mut newfile = tempfile()?;
let trace_str = match decode_trace(trace) {
let trace_str = match encode_trace(trace) {
Ok(s) => s,
Err(e) => {
println!("error decoding trace: {}", e);
println!("error encoding trace: {}", e);
continue;
}
};
Expand Down
2 changes: 1 addition & 1 deletion crates/replay_gen/src/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ pub enum WasmEvent {
},
}

pub fn decode_trace(trace: Trace) -> Result<String, std::fmt::Error> {
pub fn encode_trace(trace: Trace) -> Result<String, std::fmt::Error> {
let mut s = String::new();
for event in trace {
write!(&mut s, "{:?}\n", event)?;
Expand Down

0 comments on commit 652430d

Please sign in to comment.