##// END OF EJS Templates
rhg: in path_encode, be a bit more conservative about memory usage...
rhg: in path_encode, be a bit more conservative about memory usage Use [shrink_to_fit] to match the previous behavior more closely, and potentially save (a tiny bit) of memory. FWIW, I suspect this is unnecessary, but this whole MR is about simplifying things while preserving any existing optimizations.

File last commit:

r50534:37bc3ede default
r51061:6ea3b1ac default
Show More
debugrequirements.rs
22 lines | 598 B | application/rls-services+xml | RustLexer
/ rust / rhg / src / commands / debugrequirements.rs
use crate::error::CommandError;
pub const HELP_TEXT: &str = "
Print the current repo requirements.
";
pub fn args() -> clap::Command {
clap::command!("debugrequirements").about(HELP_TEXT)
}
pub fn run(invocation: &crate::CliInvocation) -> Result<(), CommandError> {
let repo = invocation.repo?;
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');
}
invocation.ui.write_stdout(output.as_bytes())?;
Ok(())
}