mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-15 16:11:01 +00:00
remove Item::parse
This commit is contained in:
parent
b468bd6645
commit
f0fefde401
6 changed files with 17 additions and 22 deletions
|
@ -194,13 +194,6 @@ impl ast::Expr {
|
|||
}
|
||||
}
|
||||
|
||||
impl ast::Item {
|
||||
/// Returns `text`, parsed as an item, but only if it has no errors.
|
||||
pub fn parse(text: &str) -> Result<Self, ()> {
|
||||
parsing::parse_text_as(text, parser::ParserEntryPoint::Item)
|
||||
}
|
||||
}
|
||||
|
||||
impl ast::Attr {
|
||||
/// Returns `text`, parsed as an attribute, but only if it has no errors.
|
||||
pub fn parse(text: &str) -> Result<Self, ()> {
|
||||
|
|
|
@ -86,15 +86,6 @@ fn pattern_parser_tests() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn item_parser_tests() {
|
||||
fragment_parser_dir_test(
|
||||
&["parser/fragments/item/ok"],
|
||||
&["parser/fragments/item/err"],
|
||||
crate::ast::Item::parse,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn stmt_parser_tests() {
|
||||
fragment_parser_dir_test(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue