mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-22 16:07:39 +00:00
Use to_string instead of to_owned
This commit is contained in:
parent
bf10496fa9
commit
866386e21f
@ -379,10 +379,10 @@ impl Cpio {
|
|||||||
fn ls(&self, path: Option<&str>, recursive: bool) {
|
fn ls(&self, path: Option<&str>, recursive: bool) {
|
||||||
let path = path
|
let path = path
|
||||||
.map(norm_path)
|
.map(norm_path)
|
||||||
.map(|p| "/".to_owned() + p.as_str())
|
.filter(|p| !p.is_empty())
|
||||||
.unwrap_or("".to_string());
|
.map_or("".to_string(), |p| "/".to_string() + p.as_str());
|
||||||
for (name, entry) in &self.entries {
|
for (name, entry) in &self.entries {
|
||||||
let p = "/".to_owned() + name.as_str();
|
let p = "/".to_string() + name.as_str();
|
||||||
if !p.starts_with(&path) {
|
if !p.starts_with(&path) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user