Remove the exponential API
This commit is contained in:
parent
0448e30dd9
commit
4fda83fe17
8 changed files with 248 additions and 150 deletions
|
|
@ -32,9 +32,6 @@ impl TextWithCursors {
|
|||
|
||||
#[must_use]
|
||||
pub fn cursors(&self) -> Vec<CursorPosition> { self.cursors.clone() }
|
||||
|
||||
#[must_use]
|
||||
pub fn new_owned(text: String, cursors: Vec<CursorPosition>) -> Self { Self { text, cursors } }
|
||||
}
|
||||
|
||||
impl<'a> From<&'a str> for TextWithCursors {
|
||||
|
|
@ -45,3 +42,21 @@ impl<'a> From<&'a str> for TextWithCursors {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&String> for TextWithCursors {
|
||||
fn from(text: &String) -> Self {
|
||||
Self {
|
||||
text: text.to_owned(),
|
||||
cursors: Vec::new(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<String> for TextWithCursors {
|
||||
fn from(text: String) -> Self {
|
||||
Self {
|
||||
text,
|
||||
cursors: Vec::new(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue