Commit Graph

6 Commits

Author SHA1 Message Date
Benjamin Sago f8df02dae7 Batch source formatting
I read through every file and applied a couple of rustfmt suggestions. The brace placement and alignment of items on similar lines has been made consistent, even if neither are rustfmt's default style (a file has been put in place to enforce this). Other changes are:

• Alphabetical imports and modules
• Comma placement at the end of match blocks
• Use newlines and indentation judiciously
• Spaces around associated types
• Spaces after negations (it makes it more clear imho)
• Comment formatting
• Use early-returns and Optional `?` where appropriate
2020-10-10 20:02:55 +01:00
Benjamin Sago f0c139ca68 Better referencing
This commit makes changes to the way variables are referenced:

• Make types Copy when possible
• Make methods take `self` instead of `&self` where possible (trivially_copy_pass_by_ref)
• Remove unnecessary borrowing (needless_ref)
• Remove unnecessary cloning (clone_on_copy)
• Remove `ref` from match arms where possible (new Rust match ergonomics)
2020-10-10 15:30:19 +01:00
Benjamin Sago 70a30ed683 The Selfening
This commit uses Clippy to fix all the 'use_self' warnings. Using Self instead of the type name has been good Rust style for a while now, and it's become the style I'm used to seeing.
2020-10-10 13:55:26 +01:00
Bond_009 f599c7ce93 Update to Rust 2018 2019-07-19 20:40:21 +02:00
Benjamin Sago 276d18cf7c Give block and character devices different colours
There are now two device colours instead of one. Even though they’re both set to the same style for the default colour set, LS_COLORS allows the two to look different, so exa has to support it too.

It’s probably a good idea to support it anyway.
2017-08-26 14:30:33 +01:00
Benjamin Sago 9b24649d68 Reverse what knows how to render a cell
This commit adds many traits, all named ‘Colours’, to the code. Each one asks for a colour needed to render a cell: the number of links asks for colours for the number and the multi-link-file special case; the file size asks for number, unit, punctuation, and device ID colours, or it can do a scale with its own colours, however it wants.

This is a step towards LS_COLORS compatibility, believe it or not. If a text cell in a column doesn’t depend on Colours to render itself, then the source of the colours is open-ended.

I am glad to have not needed any test changes here.
2017-08-20 20:29:23 +01:00