Developer documentation
Build
To install from source, you'll need to install Rust and Cargo. Follow the instructions on the Rust installation page. Then, get the source:
git clone https://github.com/langston-barrett/lesshand
cd lesshand
Finally, build everything:
cargo build --release
You can find binaries in target/release
. Run tests with cargo test
.
Docs
HTML documentation can be built with mdBook:
cd doc
mdbook build
# or
mdbook serve
Linting and formatting
Profile
Samply
To use Samply:
cargo install samply
cargo build --profile=profiling
samply record ./target/profiling/lesshand-design metrics corpora/gutenberg-out/ff/f168b70c0d6881f52cbde414ca2f6c4d7287e827649bed6a892550b178d3c6.txt
Warnings
Warnings are disallowed in the CI build. Warnings are configured in the top-
level Cargo.toml
file. We reject all warn-by-default rustc
lints, as well
as a subset of allowed-by-default lints. The goal is to balance high-quality,
maintainable code with not annoying developers.
To allow a lint in one spot, use:
#![allow(unused)] fn main() { #[allow(name_of_lint)] }
Speeding things up
To speed things up a bit, try putting this in .cargo/config.toml
:
[build]
rustflags = ["-C", "target-cpu=native"]