Skip to content

Commit 3273b19

Browse files
committed
gio: Use OsStr::to_str() instead of OsString::into_string() to avoid unnecessary heap allocations
1 parent 1de4242 commit 3273b19

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gio/src/subclass/application.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ mod tests {
425425

426426
for arg in arguments {
427427
// TODO: we need https://github.com/rust-lang/rust/issues/49802
428-
let a = arg.into_string().unwrap();
428+
let a = arg.to_str().unwrap();
429429
assert!(!a.starts_with("--local-"))
430430
}
431431

@@ -437,7 +437,7 @@ mod tests {
437437

438438
for (i, line) in arguments.iter().enumerate() {
439439
// TODO: we need https://github.com/rust-lang/rust/issues/49802
440-
let l = line.clone().into_string().unwrap();
440+
let l = line.to_str().unwrap();
441441
if l.starts_with("--local-") {
442442
rm.push(i)
443443
}

0 commit comments

Comments
 (0)