Skip to content

Commit

Permalink
more small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
zehiko committed Dec 19, 2024
1 parent b5c13a9 commit 97cc07c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion crates/store/re_log_encoding/src/codec/wire/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use re_chunk::TransportChunk;
/// Encode a transport chunk into a byte stream.
pub fn encode(
version: re_protos::common::v0::EncoderVersion,
chunk: TransportChunk,
chunk: &TransportChunk,
) -> Result<Vec<u8>, CodecError> {
match version {
re_protos::common::v0::EncoderVersion::V0 => {
Expand Down
10 changes: 5 additions & 5 deletions crates/store/re_log_encoding/src/codec/wire/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub use encoder::encode;
#[cfg(test)]
mod tests {
use crate::{
codec::wire::{decode, encode, TransportMessageV0},
codec::wire::{decode, encode},
codec::CodecError,
};
use re_chunk::{Chunk, RowId};
Expand Down Expand Up @@ -38,9 +38,9 @@ mod tests {
}

#[test]
fn test_invalid_batch_data() {
let data = vec![2, 3, 4]; // '1' is NO_DATA message header
let decoded = TransportMessageV0::from_bytes(&data);
fn test_invalid_data() {
let data = vec![2, 3, 4];
let decoded = decode(EncoderVersion::V0, &data);

assert!(matches!(
decoded.err().unwrap(),
Expand All @@ -54,7 +54,7 @@ mod tests {

let encoded = encode(
EncoderVersion::V0,
expected_chunk.clone().to_transport().unwrap(),
&expected_chunk.clone().to_transport().unwrap(),
)
.unwrap();
let decoded = decode(EncoderVersion::V0, &encoded).unwrap();
Expand Down
4 changes: 2 additions & 2 deletions rerun_py/src/remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ impl PyStorageNodeClient {

let metadata_tc = TransportChunk::from_arrow_record_batch(&metadata);

encode(EncoderVersion::V0, metadata_tc)
encode(EncoderVersion::V0, &metadata_tc)
.map_err(|err| PyRuntimeError::new_err(err.to_string()))
})
.transpose()?
Expand Down Expand Up @@ -339,7 +339,7 @@ impl PyStorageNodeClient {
let request = UpdateCatalogRequest {
metadata: Some(DataframePart {
encoder_version: EncoderVersion::V0 as i32,
payload: encode(EncoderVersion::V0, metadata_tc)
payload: encode(EncoderVersion::V0, &metadata_tc)
.map_err(|err| PyRuntimeError::new_err(err.to_string()))?,
}),
};
Expand Down

0 comments on commit 97cc07c

Please sign in to comment.