Skip to content

Commit 6fd8f21

Browse files
committed
Remove #![feature(str_char)]
1 parent bcbdb8a commit 6fd8f21

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#![crate_name = "cssparser"]
66
#![crate_type = "rlib"]
77

8-
#![feature(core, str_char)]
8+
#![feature(core)]
99
#![deny(missing_docs)]
1010

1111
/*!

src/tokenizer.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ impl<'a> Tokenizer<'a> {
316316

317317
#[inline]
318318
fn char_at(&self, offset: usize) -> char {
319-
self.input.char_at(self.position + offset)
319+
self.input[self.position + offset..].chars().next().unwrap()
320320
}
321321

322322
#[inline]
@@ -327,9 +327,9 @@ impl<'a> Tokenizer<'a> {
327327

328328
#[inline]
329329
fn consume_char(&mut self) -> char {
330-
let range = self.input.char_range_at(self.position);
331-
self.position = range.next;
332-
range.ch
330+
let c = self.next_char();
331+
self.position += c.len_utf8();
332+
c
333333
}
334334

335335
#[inline]

0 commit comments

Comments
 (0)