fix: Validate literals in proc-macro-srv FreeFunctions::literal_from_str

This commit is contained in:
Lukas Wirth 2024-02-13 12:33:51 +01:00
parent 925705e0c9
commit ed57008510
9 changed files with 110 additions and 108 deletions

View file

@ -204,16 +204,6 @@ pub trait IsString: AstToken {
assert!(TextRange::up_to(contents_range.len()).contains_range(range));
Some(range + contents_range.start())
}
fn raw_delimiter_count(&self) -> Option<u8> {
let text = self.text();
let quote_range = self.text_range_between_quotes()?;
let range_start = self.syntax().text_range().start();
text[TextRange::up_to((quote_range - range_start).start())]
.matches('#')
.count()
.try_into()
.ok()
}
}
impl IsString for ast::String {