mirror of
https://github.com/sharkdp/bat
synced 2024-11-23 20:33:06 +00:00
HighlightingAssets: No need for both path and path_str
This commit is contained in:
parent
9ed9a6fc3d
commit
b034879eae
1 changed files with 2 additions and 3 deletions
|
@ -201,7 +201,7 @@ impl HighlightingAssets {
|
|||
// Get the path of the file:
|
||||
// If this was set by the metadata, that will take priority.
|
||||
// If it wasn't, it will use the real file path (if available).
|
||||
let path_str = input
|
||||
let path = input
|
||||
.metadata
|
||||
.user_provided_name
|
||||
.as_ref()
|
||||
|
@ -210,9 +210,8 @@ impl HighlightingAssets {
|
|||
_ => None,
|
||||
});
|
||||
|
||||
let path_syntax = if let Some(path_str) = path_str {
|
||||
let path_syntax = if let Some(path) = path {
|
||||
// If a path was provided, we try and detect the syntax based on extension mappings.
|
||||
let path = Path::new(path_str);
|
||||
let absolute_path = PathAbs::new(path)
|
||||
.ok()
|
||||
.map(|p| p.as_path().to_path_buf())
|
||||
|
|
Loading…
Reference in a new issue