Skip to content

Commit a32fa0e

Browse files
committed
Change to_bstring_do_not_use to into_bstring_do_not_use
1 parent c38de24 commit a32fa0e

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

gix-object/src/tree/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,8 @@ impl RepositoryPathPuf {
354354
///
355355
/// This method is intended to be used during the transition from `BString` to
356356
/// `RepositoryPathBuf` as long as there are APIs that expect the former instead of the latter.
357-
pub fn to_bstring_do_not_use(&self) -> BString {
358-
self.inner.clone()
357+
pub fn into_bstring_do_not_use(self) -> BString {
358+
self.inner
359359
}
360360
}
361361

gix-object/src/tree/write.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ impl crate::WriteTo for Tree {
4242

4343
if filename.find_byte(0).is_some() {
4444
return Err(Error::NullbyteInFilename {
45-
name: filename.to_bstring_do_not_use(),
45+
name: filename.clone().into_bstring_do_not_use(),
4646
}
4747
.into());
4848
}

gix/src/object/tree/editor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,14 +288,14 @@ fn write_cursor<'repo>(cursor: &mut Cursor<'_, 'repo>) -> Result<Id<'repo>, writ
288288
cursor.validate,
289289
)
290290
.map_err(|err| write::Error::InvalidFilename {
291-
filename: entry.filename.to_bstring_do_not_use(),
291+
filename: entry.filename.clone().into_bstring_do_not_use(),
292292
kind: entry.mode.into(),
293293
id: entry.oid,
294294
source: err,
295295
})?;
296296
if !entry.mode.is_commit() && !cursor.repo.has_object(entry.oid) {
297297
return Err(write::Error::MissingObject {
298-
filename: entry.filename.to_bstring_do_not_use(),
298+
filename: entry.filename.clone().into_bstring_do_not_use(),
299299
kind: entry.mode.into(),
300300
id: entry.oid,
301301
});

0 commit comments

Comments
 (0)