Skip to content

Commit 0528476

Browse files
committed
fix build errors
1 parent d4a6931 commit 0528476

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ascii/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ fn add_styled_segment(base: &mut String, segment: &str, color: DynColors, bold:
254254

255255
type ParseResult<'a, R> = Option<(&'a str, R)>;
256256

257-
fn token<R>(s: &str, predicate: impl FnOnce(char) -> Option<R>) -> ParseResult<R> {
257+
fn token<'a, R>(s: &'a str, predicate: impl FnOnce(char) -> Option<R>) -> ParseResult<'a, R> {
258258
let mut chars = s.chars();
259259
let token = chars.next()?;
260260
let result = predicate(token)?;
@@ -264,20 +264,20 @@ fn token<R>(s: &str, predicate: impl FnOnce(char) -> Option<R>) -> ParseResult<R
264264
// Parsers
265265

266266
/// Parses a color indicator of the format `{n}` where `n` is a digit.
267-
fn color_token(s: &str) -> ParseResult<Token> {
267+
fn color_token<'a>(s: &'a str) -> ParseResult<'a, Token> {
268268
let (s, ()) = token(s, succeed_when(|c| c == '{'))?;
269269
let (s, color_index) = token(s, |c| c.to_digit(10))?;
270270
let (s, ()) = token(s, succeed_when(|c| c == '}'))?;
271271
Some((s, Token::Color(color_index)))
272272
}
273273

274274
/// Parses a space.
275-
fn space_token(s: &str) -> ParseResult<Token> {
275+
fn space_token<'a>(s: &'a str) -> ParseResult<'a, Token> {
276276
token(s, succeed_when(|c| c == ' ')).map(|(s, ())| (s, Token::Space))
277277
}
278278

279279
/// Parses any arbitrary character. This cannot fail.
280-
fn char_token(s: &str) -> ParseResult<Token> {
280+
fn char_token<'a>(s: &'a str) -> ParseResult<'a, Token> {
281281
token(s, |c| Some(Token::Char(c)))
282282
}
283283

0 commit comments

Comments
 (0)