From 04fe512f0d3567727cfb9ccab166c5344716711a Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 24 Jun 2020 11:51:45 +0200 Subject: Simplify --- crates/ra_ide/src/mock_analysis.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'crates/ra_ide/src/mock_analysis.rs') diff --git a/crates/ra_ide/src/mock_analysis.rs b/crates/ra_ide/src/mock_analysis.rs index 79b796544..b7325bfc3 100644 --- a/crates/ra_ide/src/mock_analysis.rs +++ b/crates/ra_ide/src/mock_analysis.rs @@ -79,9 +79,6 @@ pub struct MockAnalysis { } impl MockAnalysis { - pub fn new() -> MockAnalysis { - MockAnalysis::default() - } /// Creates `MockAnalysis` using a fixture data in the following format: /// /// ```not_rust @@ -93,7 +90,7 @@ impl MockAnalysis { /// struct Baz; /// ``` pub fn with_files(fixture: &str) -> MockAnalysis { - let mut res = MockAnalysis::new(); + let mut res = MockAnalysis::default(); for entry in Fixture::parse(fixture) { res.add_file_fixture(entry); } @@ -104,7 +101,7 @@ impl MockAnalysis { /// whose position is also returned. pub fn with_files_and_position(fixture: &str) -> (MockAnalysis, FilePosition) { let mut position = None; - let mut res = MockAnalysis::new(); + let mut res = MockAnalysis::default(); for mut entry in Fixture::parse(fixture) { if entry.text.contains(CURSOR_MARKER) { assert!(position.is_none(), "only one marker (<|>) per fixture is allowed"); @@ -213,7 +210,7 @@ pub fn single_file(ra_fixture: &str) -> (Analysis, FileId) { /// Creates analysis for a single file, returns range marked with a pair of <|>. pub fn single_file_with_range(ra_fixture: &str) -> (Analysis, FileRange) { - let mut mock = MockAnalysis::new(); + let mut mock = MockAnalysis::default(); let pos = mock.add_file_with_range("/main.rs", ra_fixture); (mock.analysis(), pos) } -- cgit v1.2.3