Skip to content

Commit 1026557

Browse files
committed
perf: add inline to Drop impls
1 parent 723d75b commit 1026557

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,7 @@ impl Clone for LeanString {
916916
///
917917
/// This ensures no memory leaks occur and all resources are properly cleaned up.
918918
impl Drop for LeanString {
919+
#[inline]
919920
fn drop(&mut self) {
920921
self.0.replace_inner(Repr::new());
921922
}

src/repr.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,7 @@ impl Repr {
412412
}
413413

414414
impl Drop for SetLenOnDrop<'_> {
415+
#[inline]
415416
fn drop(&mut self) {
416417
// SAFETY:
417418
// - `dst_idx <= src_idx`, and `src_idx <= len`, so `dst_idx <= len`.

0 commit comments

Comments
 (0)