mirror of
https://github.com/Llewellynvdm/exa.git
synced 2024-11-05 12:27:53 +00:00
c911b5f6e4
A recent change to ansi-term [1] means that `ANSIString`s can now hold either owned *or* borrowed data (Rust calls this the Cow type). This means that we can delay formatting ANSIStrings into ANSI-control-code-formatted strings until it's absolutely necessary. The process for doing this was: 1. Replace the `Cell` type with a `TextCell` type that holds a vector of `ANSIString` values instead of a formatted string. It still does the width tracking. 2. Rework the details module's `render` functions to emit values of this type. 3. Similarly, rework the functions that produce cells containing filenames to use a `File` value's `name` field, which is an owned `String` that can now be re-used. 4. Update the printing, formatting, and width-calculating code in the details and grid-details views to produce a table by adding vectors together instead of adding strings together, delaying the formatting as long as it can. This results in fewer allocations (as fewer `String` values are produced), and makes the API tidier (as fewer `String` values are being passed around without having their contents specified). This also paves the way to Windows support, or at least support for non-ANSI terminals: by delaying the time until strings are formatted, it'll now be easier to change *how* they are formatted. Casualties include: - Bump to ansi_term v0.7.1, which impls `PartialEq` and `Debug` on `ANSIString`. - The grid_details and lines views now need to take a vector of files, rather than a borrowed slice, so the filename cells produced now own the filename strings that get taken from files. - Fixed the signature of `File#link_target` to specify that the file produced refers to the same directory, rather than some phantom directory with the same lifetime as the file. (This was wrong from the start, but it broke nothing until now) References: [1]: ansi-term@f6a6579ba8174de1cae64d181ec04af32ba2a4f0
380 lines
12 KiB
TOML
380 lines
12 KiB
TOML
[root]
|
|
name = "exa"
|
|
version = "0.4.0"
|
|
dependencies = [
|
|
"ansi_term 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"datetime 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"git2 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"libc 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"locale 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"natord 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"num_cpus 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"number_prefix 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"scoped_threadpool 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"term_grid 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"unicode-width 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"users 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "advapi32-sys"
|
|
version = "0.1.2"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "aho-corasick"
|
|
version = "0.4.0"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"memchr 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "ansi_term"
|
|
version = "0.7.1"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
[[package]]
|
|
name = "bitflags"
|
|
version = "0.1.1"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
[[package]]
|
|
name = "byteorder"
|
|
version = "0.4.2"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
[[package]]
|
|
name = "cmake"
|
|
version = "0.1.11"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"gcc 0.3.20 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "datetime"
|
|
version = "0.4.1"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"libc 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"locale 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"num 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"pad 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"regex 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"tz 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "gcc"
|
|
version = "0.3.20"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"advapi32-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "getopts"
|
|
version = "0.2.14"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
[[package]]
|
|
name = "git2"
|
|
version = "0.3.3"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"libc 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"libgit2-sys 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"url 0.2.38 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "kernel32-sys"
|
|
version = "0.2.1"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "lazy_static"
|
|
version = "0.1.15"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
[[package]]
|
|
name = "libc"
|
|
version = "0.1.12"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
[[package]]
|
|
name = "libc"
|
|
version = "0.2.3"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
[[package]]
|
|
name = "libgit2-sys"
|
|
version = "0.3.8"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"cmake 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"libc 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"libssh2-sys 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"libz-sys 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"openssl-sys 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"pkg-config 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "libressl-pnacl-sys"
|
|
version = "2.1.6"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"pnacl-build-helper 1.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "libssh2-sys"
|
|
version = "0.1.34"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"cmake 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"libc 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"libz-sys 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"openssl-sys 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"pkg-config 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "libz-sys"
|
|
version = "1.0.0"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"gcc 0.3.20 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"libc 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"pkg-config 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "locale"
|
|
version = "0.1.8"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"libc 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"num 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "matches"
|
|
version = "0.1.2"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
[[package]]
|
|
name = "memchr"
|
|
version = "0.1.7"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"libc 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "natord"
|
|
version = "1.0.9"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
[[package]]
|
|
name = "num"
|
|
version = "0.1.28"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"rand 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "num_cpus"
|
|
version = "0.2.10"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"libc 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "number_prefix"
|
|
version = "0.2.5"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"num 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "openssl-sys"
|
|
version = "0.7.2"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"libc 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"libressl-pnacl-sys 2.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"pkg-config 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "pad"
|
|
version = "0.1.4"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"unicode-width 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "pkg-config"
|
|
version = "0.3.6"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
[[package]]
|
|
name = "pnacl-build-helper"
|
|
version = "1.4.10"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"tempdir 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "rand"
|
|
version = "0.3.12"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"advapi32-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"libc 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "regex"
|
|
version = "0.1.43"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"aho-corasick 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"memchr 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"regex-syntax 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "regex-syntax"
|
|
version = "0.2.2"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
[[package]]
|
|
name = "rustc-serialize"
|
|
version = "0.3.16"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
[[package]]
|
|
name = "rustc_version"
|
|
version = "0.1.4"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "scoped_threadpool"
|
|
version = "0.1.6"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"rustc_version 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "semver"
|
|
version = "0.1.20"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
[[package]]
|
|
name = "tempdir"
|
|
version = "0.3.4"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"rand 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "term_grid"
|
|
version = "0.1.3"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"unicode-width 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "tz"
|
|
version = "0.2.1"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"byteorder 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "unicode-width"
|
|
version = "0.1.3"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
[[package]]
|
|
name = "url"
|
|
version = "0.2.38"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"uuid 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "users"
|
|
version = "0.4.4"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"libc 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "uuid"
|
|
version = "0.1.18"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"rand 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|
|
[[package]]
|
|
name = "winapi"
|
|
version = "0.2.5"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
[[package]]
|
|
name = "winapi-build"
|
|
version = "0.1.1"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
|
[[package]]
|
|
name = "ws2_32-sys"
|
|
version = "0.2.1"
|
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
dependencies = [
|
|
"winapi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
]
|
|
|