MCPcopy Create free account
hub / github.com/RustOtomeLab/RustEng / next_character

Method next_character

src/executors/text_executor.rs:113–133  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

111 }
112
113 fn next_character(&mut self) -> Option<String> {
114 if !self.is_running {
115 return None;
116 }
117
118 if self.current_index >= self.full_text.chars().count() {
119 self.is_running = false;
120 return None;
121 }
122
123 let chars: Vec<char> = self.full_text.chars().collect();
124 if self.current_index + 5 <= self.full_text.chars().count()
125 && chars[self.current_index..self.current_index + 5] == ['{', 'n', 'n', 's', '}']
126 {
127 self.current_index += 5;
128 }
129 let displayed_text: String = chars[..=self.current_index].iter().collect();
130 self.current_index += 1;
131
132 Some(displayed_text)
133 }
134}

Callers 1

newMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected