Skip to content

Commit 7d59d5a

Browse files
committed
refactor: drop unused trait impls for StringOffset
1 parent b224284 commit 7d59d5a

File tree

3 files changed

+3
-53
lines changed

3 files changed

+3
-53
lines changed

datadog-alloc/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,3 @@ pub use virtual_alloc::*;
1919

2020
// Expose allocator_api2 for our users.
2121
pub use allocator_api2::alloc::*;
22-

datadog-profiling-ffi/src/status.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2025-Present Datadog, Inc. https://www.datadoghq.com/
22
// SPDX-License-Identifier: Apache-2.0
33

4-
use allocator_api2::alloc::{Allocator, AllocError, Global, Layout};
4+
use allocator_api2::alloc::{AllocError, Allocator, Global, Layout};
55
use datadog_profiling::profiles::FallibleStringWriter;
66
use std::borrow::Cow;
77
use std::ffi::{c_char, CStr, CString};

datadog-profiling-protobuf/src/string.rs

Lines changed: 2 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
use crate::{varint, Value, WireType};
5-
use std::ops::Sub;
6-
use std::{
7-
fmt,
8-
io::{self, Write},
9-
ops::{Add, Mul},
10-
};
5+
use std::fmt;
6+
use std::io::{self, Write};
117

128
unsafe impl Value for &str {
139
const WIRE_TYPE: WireType = WireType::LengthDelimited;
@@ -195,48 +191,3 @@ impl StringOffset {
195191
Some(Self(self.0.checked_add(rhs_u32)?))
196192
}
197193
}
198-
199-
impl Add<u32> for StringOffset {
200-
type Output = StringOffset;
201-
202-
#[inline]
203-
fn add(self, rhs: u32) -> Self::Output {
204-
StringOffset::new(self.0 + rhs)
205-
}
206-
}
207-
208-
impl Sub<u32> for StringOffset {
209-
type Output = StringOffset;
210-
211-
#[inline]
212-
fn sub(self, rhs: u32) -> Self::Output {
213-
StringOffset::new(self.0 - rhs)
214-
}
215-
}
216-
217-
impl Add<StringOffset> for u32 {
218-
type Output = StringOffset;
219-
220-
#[inline]
221-
fn add(self, rhs: StringOffset) -> Self::Output {
222-
StringOffset::new(self + rhs.0)
223-
}
224-
}
225-
226-
impl Add<StringOffset> for StringOffset {
227-
type Output = StringOffset;
228-
229-
#[inline]
230-
fn add(self, rhs: StringOffset) -> Self::Output {
231-
StringOffset::new(self.0 + rhs.0)
232-
}
233-
}
234-
235-
impl Mul<bool> for StringOffset {
236-
type Output = StringOffset;
237-
238-
#[inline]
239-
fn mul(self, rhs: bool) -> Self::Output {
240-
StringOffset::new(self.0 * (rhs as u32))
241-
}
242-
}

0 commit comments

Comments
 (0)