aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_text_edit/src
diff options
context:
space:
mode:
authorBernardo <[email protected]>2018-12-25 19:49:18 +0000
committerBernardo <[email protected]>2018-12-25 19:49:18 +0000
commite9c186e48a77b536053c0f75ac9ea5b2fd322cfa (patch)
tree250b7f1c4b29e1ca009f6ff913733401caefdb2c /crates/ra_text_edit/src
parent863ed19946d6f707ce09dd77bf26b26be73e097c (diff)
change to `TextEdit` to avoid allocation and sort
rename newline to step where applicable
Diffstat (limited to 'crates/ra_text_edit/src')
-rw-r--r--crates/ra_text_edit/src/test_utils.rs12
1 files changed, 6 insertions, 6 deletions
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<TextEdit> {
69} 69}
70 70
71#[derive(Debug, Clone)] 71#[derive(Debug, Clone)]
72pub struct ArbTextWithEdits { 72pub struct ArbTextWithEdit {
73 pub text: String, 73 pub text: String,
74 pub edits: TextEdit, 74 pub edit: TextEdit,
75} 75}
76 76
77pub fn arb_text_with_edits() -> BoxedStrategy<ArbTextWithEdits> { 77pub fn arb_text_with_edit() -> BoxedStrategy<ArbTextWithEdit> {
78 let text = arb_text(); 78 let text = arb_text();
79 text.prop_flat_map(|s| { 79 text.prop_flat_map(|s| {
80 let edits = arb_text_edit(&s); 80 let edit = arb_text_edit(&s);
81 (Just(s), edits) 81 (Just(s), edit)
82 }) 82 })
83 .prop_map(|(text, edits)| ArbTextWithEdits { text, edits }) 83 .prop_map(|(text, edit)| ArbTextWithEdit { text, edit })
84 .boxed() 84 .boxed()
85} 85}