Skip to content

Commit b4097fc

Browse files
Remove the generic SerializationSink parameter from StringTableBuilder.
1 parent 603f0c9 commit b4097fc

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

analyzeme/src/profiling_data.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ pub struct ProfilingDataBuilder {
204204
event_sink: FileSerializationSink,
205205
string_table_data_sink: Arc<FileSerializationSink>,
206206
string_table_index_sink: Arc<FileSerializationSink>,
207-
string_table: StringTableBuilder<FileSerializationSink>,
207+
string_table: StringTableBuilder,
208208
}
209209

210210
impl ProfilingDataBuilder {

measureme/src/profiler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ impl ProfilerFiles {
2727

2828
pub struct Profiler {
2929
event_sink: Arc<FileSerializationSink>,
30-
string_table: StringTableBuilder<FileSerializationSink>,
30+
string_table: StringTableBuilder,
3131
start_time: Instant,
3232
}
3333

measureme/src/stringtable.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
use crate::file_header::{
6767
write_file_header, FILE_MAGIC_STRINGTABLE_DATA, FILE_MAGIC_STRINGTABLE_INDEX,
6868
};
69+
use crate::file_serialization_sink::FileSerializationSink;
6970
use crate::serialization::{Addr, SerializationSink};
7071
use std::sync::Arc;
7172

@@ -135,9 +136,9 @@ const INVALID_STRING_ID: u32 = METADATA_STRING_ID + 1;
135136
pub const FIRST_REGULAR_STRING_ID: u32 = INVALID_STRING_ID + 1;
136137

137138
/// Write-only version of the string table
138-
pub struct StringTableBuilder<S: SerializationSink> {
139-
data_sink: Arc<S>,
140-
index_sink: Arc<S>,
139+
pub struct StringTableBuilder {
140+
data_sink: Arc<FileSerializationSink>,
141+
index_sink: Arc<FileSerializationSink>,
141142
}
142143

143144
/// Anything that implements `SerializableString` can be written to a
@@ -250,15 +251,18 @@ impl_serializable_string_for_fixed_size!(14);
250251
impl_serializable_string_for_fixed_size!(15);
251252
impl_serializable_string_for_fixed_size!(16);
252253

253-
fn serialize_index_entry<S: SerializationSink>(sink: &S, id: StringId, addr: Addr) {
254+
fn serialize_index_entry(sink: &FileSerializationSink, id: StringId, addr: Addr) {
254255
sink.write_atomic(8, |bytes| {
255256
bytes[0..4].copy_from_slice(&id.0.to_le_bytes());
256257
bytes[4..8].copy_from_slice(&addr.0.to_le_bytes());
257258
});
258259
}
259260

260-
impl<S: SerializationSink> StringTableBuilder<S> {
261-
pub fn new(data_sink: Arc<S>, index_sink: Arc<S>) -> StringTableBuilder<S> {
261+
impl StringTableBuilder {
262+
pub fn new(
263+
data_sink: Arc<FileSerializationSink>,
264+
index_sink: Arc<FileSerializationSink>,
265+
) -> StringTableBuilder {
262266
// The first thing in every file we generate must be the file header.
263267
write_file_header(&*data_sink, FILE_MAGIC_STRINGTABLE_DATA);
264268
write_file_header(&*index_sink, FILE_MAGIC_STRINGTABLE_INDEX);

0 commit comments

Comments
 (0)