mirror of
https://codeberg.org/icewind/vbsp.git
synced 2026-06-03 18:54:05 +02:00
use split_at in EntitiesIter
This commit is contained in:
parent
adf79d70a1
commit
1a9c6167ac
1 changed files with 4 additions and 5 deletions
|
|
@ -38,12 +38,11 @@ impl<'a> Iterator for EntitiesIter<'a> {
|
|||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
let start = self.buf.find('{')?;
|
||||
let end = start + self.buf[start..].find('}')?;
|
||||
|
||||
let out = &self.buf[start..end + 1];
|
||||
|
||||
self.buf = &self.buf[end + 1..];
|
||||
let slice = &self.buf[start..];
|
||||
let end = start + slice.find('}')?;
|
||||
let (out, rest) = slice.split_at(end + 1);
|
||||
|
||||
self.buf = rest;
|
||||
Some(RawEntity { buf: out })
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue