1
Fork 0

fix span_extend_to_next_char docs

This commit is contained in:
Goldstein 2022-08-13 23:33:21 +03:00
parent 3fb249bebc
commit 3e0df4b5d7
No known key found for this signature in database
GPG key ID: DE6031ABA0BB269A

View file

@ -722,7 +722,7 @@ impl SourceMap {
}) })
} }
/// Extends the given `Span` to just after the next occurrence of `c`. /// Extends the given `Span` to just before the next occurrence of `c`.
pub fn span_extend_to_next_char(&self, sp: Span, c: char, accept_newlines: bool) -> Span { pub fn span_extend_to_next_char(&self, sp: Span, c: char, accept_newlines: bool) -> Span {
if let Ok(next_source) = self.span_to_next_source(sp) { if let Ok(next_source) = self.span_to_next_source(sp) {
let next_source = next_source.split(c).next().unwrap_or(""); let next_source = next_source.split(c).next().unwrap_or("");