From 42b4f2fbd8c9be6abf749929f8b93299f077ddea Mon Sep 17 00:00:00 2001 From: Utkarsh Umesan Pillai <66651184+utpilla@users.noreply.github.com> Date: Wed, 1 Jan 2025 06:14:37 -0800 Subject: [PATCH] Minor refactoring- Rename the variants of LogBatchData enum (#2490) --- opentelemetry-sdk/src/export/logs/mod.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/opentelemetry-sdk/src/export/logs/mod.rs b/opentelemetry-sdk/src/export/logs/mod.rs index 4602b2f52b..245d6fe742 100644 --- a/opentelemetry-sdk/src/export/logs/mod.rs +++ b/opentelemetry-sdk/src/export/logs/mod.rs @@ -27,8 +27,8 @@ pub struct LogBatch<'a> { /// - Or it can be a shared reference to a slice of tuples, where each tuple consists of a reference to a `LogRecord` and a reference to an `InstrumentationScope`. #[derive(Debug)] enum LogBatchData<'a> { - BorrowedVec(&'a [Box<(LogRecord, InstrumentationScope)>]), // Used by BatchProcessor which clones the LogRecords for its own use. - BorrowedSlice(&'a [(&'a LogRecord, &'a InstrumentationScope)]), + SliceOfOwnedData(&'a [Box<(LogRecord, InstrumentationScope)>]), // Used by BatchProcessor which clones the LogRecords for its own use. + SliceOfBorrowedData(&'a [(&'a LogRecord, &'a InstrumentationScope)]), } impl<'a> LogBatch<'a> { @@ -48,7 +48,7 @@ impl<'a> LogBatch<'a> { /// made private in the future. pub fn new(data: &'a [(&'a LogRecord, &'a InstrumentationScope)]) -> LogBatch<'a> { LogBatch { - data: LogBatchData::BorrowedSlice(data), + data: LogBatchData::SliceOfBorrowedData(data), } } @@ -56,7 +56,7 @@ impl<'a> LogBatch<'a> { data: &'a [Box<(LogRecord, InstrumentationScope)>], ) -> LogBatch<'a> { LogBatch { - data: LogBatchData::BorrowedVec(data), + data: LogBatchData::SliceOfOwnedData(data), } } } @@ -89,7 +89,7 @@ impl<'a> Iterator for LogBatchDataIter<'a> { fn next(&mut self) -> Option { match self.data { - LogBatchData::BorrowedVec(data) => { + LogBatchData::SliceOfOwnedData(data) => { if self.index < data.len() { let record = &*data[self.index]; self.index += 1; @@ -98,7 +98,7 @@ impl<'a> Iterator for LogBatchDataIter<'a> { None } } - LogBatchData::BorrowedSlice(data) => { + LogBatchData::SliceOfBorrowedData(data) => { if self.index < data.len() { let record = &data[self.index]; self.index += 1;