Fix names
This commit is contained in:
parent
98dc11896e
commit
6b6b16af3c
5 changed files with 13 additions and 21 deletions
|
|
@ -30,7 +30,7 @@ impl CursorPosition {
|
|||
#[must_use]
|
||||
pub fn id(&self) -> usize { self.id }
|
||||
|
||||
#[cfg_attr(feature = "wasm", wasm_bindgen(js_name = characterPosition))]
|
||||
#[cfg_attr(feature = "wasm", wasm_bindgen(js_name = characterIndex))]
|
||||
#[must_use]
|
||||
pub fn char_index(&self) -> usize { self.char_index }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,19 +5,20 @@ use wasm_bindgen::prelude::*;
|
|||
|
||||
use crate::types::history::History;
|
||||
|
||||
/// Wrapper type for `(History, String)`
|
||||
/// Wrapper type for `(String, History)` where History describes the origin of
|
||||
/// `text`.
|
||||
#[cfg_attr(feature = "wasm", wasm_bindgen)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct SpanWithHistory {
|
||||
history: History,
|
||||
text: String,
|
||||
history: History,
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "wasm", wasm_bindgen)]
|
||||
impl SpanWithHistory {
|
||||
#[must_use]
|
||||
pub fn new(history: History, text: String) -> Self { SpanWithHistory { history, text } }
|
||||
pub fn new(text: String, history: History) -> Self { SpanWithHistory { text, history } }
|
||||
|
||||
#[must_use]
|
||||
pub fn history(&self) -> History { self.history }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue