-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a Colorable trait to factor out metadata retrieval
The new Colorable trait exposes accessors for file name, type, and metadata. LsColors::style_for_path() and ..._with_metadata() are now implemented in terms of style_for(Colorable). With file type potentially separated from metadata, the indicator_for() implementation is careful to only call metadata() when actually necessary to color the file. The new Colorable impl for DirEntry takes advantage of this, potentially avoiding a stat() call when d_type is sufficient. Fixes #42.
- Loading branch information
1 parent
a1a8dc2
commit 729660a
Showing
1 changed file
with
152 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters