mirror of
https://github.com/sharkdp/bat.git
synced 2025-02-21 12:28:30 +00:00
HighlightingAssets: No need for both path and path_str
This commit is contained in:
parent
9ed9a6fc3d
commit
b034879eae
@ -201,7 +201,7 @@ impl HighlightingAssets {
|
|||||||
// Get the path of the file:
|
// Get the path of the file:
|
||||||
// If this was set by the metadata, that will take priority.
|
// If this was set by the metadata, that will take priority.
|
||||||
// If it wasn't, it will use the real file path (if available).
|
// If it wasn't, it will use the real file path (if available).
|
||||||
let path_str = input
|
let path = input
|
||||||
.metadata
|
.metadata
|
||||||
.user_provided_name
|
.user_provided_name
|
||||||
.as_ref()
|
.as_ref()
|
||||||
@ -210,9 +210,8 @@ impl HighlightingAssets {
|
|||||||
_ => None,
|
_ => 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.
|
// 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)
|
let absolute_path = PathAbs::new(path)
|
||||||
.ok()
|
.ok()
|
||||||
.map(|p| p.as_path().to_path_buf())
|
.map(|p| p.as_path().to_path_buf())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user