##// END OF EJS Templates
rust: run a clippy pass with the latest stable version...
rust: run a clippy pass with the latest stable version Our current version of clippy is older than the latest stable. The newest version has new lints that are moslty good advice, so let's apply them ahead of time. This has the added benefit of reducing the noise for developpers like myself that use clippy as an IDE helper, as well as being more prepared for a future clippy upgrade.

File last commit:

r50534:37bc3ede default
r52013:532e74ad default
Show More
debugrequirements.rs
22 lines | 598 B | application/rls-services+xml | RustLexer
/ rust / rhg / src / commands / debugrequirements.rs
Simon Sapin
requirements: move loading to hg-core and add parsing...
r46536 use crate::error::CommandError;
Simon Sapin
rhg: add a `debugrequirements` subcommand...
r46535
pub const HELP_TEXT: &str = "
Print the current repo requirements.
";
Raphaël Gomès
rhg: upgrade `clap` dependency...
r50534 pub fn args() -> clap::Command {
clap::command!("debugrequirements").about(HELP_TEXT)
Simon Sapin
rhg: Move subcommand CLI arguments definitions to respective modules...
r47251 }
Simon Sapin
rhg: Group values passed to every sub-command into a struct...
r47334 pub fn run(invocation: &crate::CliInvocation) -> Result<(), CommandError> {
Simon Sapin
rhg: Move `Repo` object creation into `main()`...
r47335 let repo = invocation.repo?;
Simon Sapin
rhg: replace command structs with functions...
r47250 let mut output = String::new();
let mut requirements: Vec<_> = repo.requirements().iter().collect();
requirements.sort();
for req in requirements {
output.push_str(req);
output.push('\n');
Simon Sapin
rhg: add a `debugrequirements` subcommand...
r46535 }
Simon Sapin
rhg: Group values passed to every sub-command into a struct...
r47334 invocation.ui.write_stdout(output.as_bytes())?;
Simon Sapin
rhg: replace command structs with functions...
r47250 Ok(())
Simon Sapin
rhg: add a `debugrequirements` subcommand...
r46535 }