forked from mirrors/jj
diff_utils: return &str
from basic_diff_file_type()
We don't currently need an owned `String`.
This commit is contained in:
parent
b5909dfc34
commit
bf36933d9d
1 changed files with 7 additions and 7 deletions
|
@ -362,22 +362,22 @@ fn diff_content(path: &RepoPath, value: MaterializedTreeValue) -> Result<Vec<u8>
|
|||
}
|
||||
}
|
||||
|
||||
fn basic_diff_file_type(value: &MaterializedTreeValue) -> String {
|
||||
fn basic_diff_file_type(value: &MaterializedTreeValue) -> &'static str {
|
||||
match value {
|
||||
MaterializedTreeValue::Absent => {
|
||||
panic!("absent path in diff");
|
||||
}
|
||||
MaterializedTreeValue::File { executable, .. } => {
|
||||
if *executable {
|
||||
"executable file".to_string()
|
||||
"executable file"
|
||||
} else {
|
||||
"regular file".to_string()
|
||||
"regular file"
|
||||
}
|
||||
}
|
||||
MaterializedTreeValue::Symlink { .. } => "symlink".to_string(),
|
||||
MaterializedTreeValue::Tree(_) => "tree".to_string(),
|
||||
MaterializedTreeValue::GitSubmodule(_) => "Git submodule".to_string(),
|
||||
MaterializedTreeValue::Conflict { .. } => "conflict".to_string(),
|
||||
MaterializedTreeValue::Symlink { .. } => "symlink",
|
||||
MaterializedTreeValue::Tree(_) => "tree",
|
||||
MaterializedTreeValue::GitSubmodule(_) => "Git submodule",
|
||||
MaterializedTreeValue::Conflict { .. } => "conflict",
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue