Skip to content

Commit

Permalink
refactor: rename encode_str to encode_string_table_entry
Browse files Browse the repository at this point in the history
  • Loading branch information
morrisonlevi committed Feb 12, 2024
1 parent f211e84 commit 03e808d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion profiling/src/internal/profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ impl Profile {
}

for item in self.strings.into_iter() {
encoder.encode_str(item)?;
encoder.encode_string_table_entry(item)?;
}

encoder.encode(ProfileSimpler {
Expand Down
6 changes: 5 additions & 1 deletion profiling/src/serializer/compressed_streaming_encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ impl CompressedProtobufSerializer {
/// implementation of [prost::Message::encode] but for any `AsRef<str>`,
/// and specialized for handling the unlikely OOM conditions of writing
/// into a `Vec<u8>`.
pub(crate) fn encode_str(&mut self, item: impl AsRef<str>) -> anyhow::Result<()> {
pub(crate) fn encode_string_table_entry(
&mut self,
item: impl AsRef<str>,
) -> anyhow::Result<()> {
// In pprof, string tables are tag 6 on the Profile message.
let tag = 6u32;
let str = item.as_ref();
let encoded_len = encoded_len_varint(str.len() as u64);
Expand Down

0 comments on commit 03e808d

Please sign in to comment.