Remove the exponential API

This commit is contained in:
Andras Schmelczer 2025-06-29 19:03:55 +01:00
parent 0448e30dd9
commit 4fda83fe17
8 changed files with 248 additions and 150 deletions

View file

@ -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(),
}
}
}