preallocate
This commit is contained in:
parent
1461382de8
commit
134d82a08b
1 changed files with 3 additions and 1 deletions
|
@ -14,7 +14,9 @@ fn main() {
|
|||
args.next().unwrap();
|
||||
let min_syllables: usize = args.next().expect("one arg").parse().expect("a number");
|
||||
|
||||
let mut message = String::with_capacity(128);
|
||||
// the vast, vast majority of discord messages are under 2000 chars, so this avoids
|
||||
// reallocating
|
||||
let mut message = String::with_capacity(2048);
|
||||
io::stdin()
|
||||
.read_to_string(&mut message)
|
||||
.expect("i want a message");
|
||||
|
|
Loading…
Reference in a new issue