From e9c186e48a77b536053c0f75ac9ea5b2fd322cfa Mon Sep 17 00:00:00 2001 From: Bernardo Date: Tue, 25 Dec 2018 20:49:18 +0100 Subject: change to `TextEdit` to avoid allocation and sort rename newline to step where applicable --- crates/ra_text_edit/src/test_utils.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'crates/ra_text_edit/src') diff --git a/crates/ra_text_edit/src/test_utils.rs b/crates/ra_text_edit/src/test_utils.rs index f0b8dfde1..745f21c93 100644 --- a/crates/ra_text_edit/src/test_utils.rs +++ b/crates/ra_text_edit/src/test_utils.rs @@ -69,17 +69,17 @@ pub fn arb_text_edit(text: &str) -> BoxedStrategy { } #[derive(Debug, Clone)] -pub struct ArbTextWithEdits { +pub struct ArbTextWithEdit { pub text: String, - pub edits: TextEdit, + pub edit: TextEdit, } -pub fn arb_text_with_edits() -> BoxedStrategy { +pub fn arb_text_with_edit() -> BoxedStrategy { let text = arb_text(); text.prop_flat_map(|s| { - let edits = arb_text_edit(&s); - (Just(s), edits) + let edit = arb_text_edit(&s); + (Just(s), edit) }) - .prop_map(|(text, edits)| ArbTextWithEdits { text, edits }) + .prop_map(|(text, edit)| ArbTextWithEdit { text, edit }) .boxed() } -- cgit v1.2.3