Skip to content

Commit 2f9d686

Browse files
committed
chore(parser): remove format!
1 parent 06e9147 commit 2f9d686

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/parser.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use alloc::{format, vec::Vec};
1+
use alloc::{string::ToString, vec::Vec};
22
use core::{iter::Peekable, str::CharIndices};
33

44
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
@@ -160,7 +160,12 @@ impl<'a> Iterator for Parser<'a> {
160160
self.count += 1;
161161
self.pos = i + 1;
162162
Some(Piece::Parameter(
163-
Position::Index(self.count, format!("{}{}", c, self.count).into_bytes()),
163+
Position::Index(self.count, {
164+
let mut s = Vec::new();
165+
s.push(c as u8);
166+
s.extend_from_slice(self.count.to_string().as_bytes());
167+
s
168+
}),
164169
if c == '+' {
165170
Kind::OneOrMore
166171
} else {

0 commit comments

Comments
 (0)