1
0
mirror of https://github.com/rust-lang/rustlings.git synced 2024-11-08 09:09:17 +01:00

Fix capacity

This commit is contained in:
mo8it 2024-08-01 11:26:30 +02:00
parent 766f3c50ec
commit 455d87cadd

@ -172,7 +172,7 @@ pub trait RunnableExercise {
/// The output is written to the `output` buffer after clearing it. /// The output is written to the `output` buffer after clearing it.
fn run_solution(&self, output: Option<&mut Vec<u8>>, target_dir: &Path) -> Result<bool> { fn run_solution(&self, output: Option<&mut Vec<u8>>, target_dir: &Path) -> Result<bool> {
let name = self.name(); let name = self.name();
let mut bin_name = String::with_capacity(name.len()); let mut bin_name = String::with_capacity(name.len() + 4);
bin_name.push_str(name); bin_name.push_str(name);
bin_name.push_str("_sol"); bin_name.push_str("_sol");