|
2 | 2 | // SPDX-License-Identifier: Apache-2.0
|
3 | 3 |
|
4 | 4 | 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}; |
11 | 7 |
|
12 | 8 | unsafe impl Value for &str {
|
13 | 9 | const WIRE_TYPE: WireType = WireType::LengthDelimited;
|
@@ -195,48 +191,3 @@ impl StringOffset {
|
195 | 191 | Some(Self(self.0.checked_add(rhs_u32)?))
|
196 | 192 | }
|
197 | 193 | }
|
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