mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 22:31:14 +00:00
Janitor: Find char, not a str
This commit is contained in:
parent
bf48a6c65e
commit
08a6dc02fc
1 changed files with 2 additions and 2 deletions
|
@ -39,7 +39,7 @@ fn generate_test(fn_name: &str, doc: &str) -> String {
|
||||||
Some(idx) => idx + 8,
|
Some(idx) => idx + 8,
|
||||||
None => match doc.find("```test,") {
|
None => match doc.find("```test,") {
|
||||||
None => return error("test not found"),
|
None => return error("test not found"),
|
||||||
Some(idx) => match doc[idx..].find("\n") {
|
Some(idx) => match doc[idx..].find('\n') {
|
||||||
None => return error("test not found"),
|
None => return error("test not found"),
|
||||||
Some(newline) => {
|
Some(newline) => {
|
||||||
kind = Some(&doc[idx + 8..idx + newline]);
|
kind = Some(&doc[idx + 8..idx + newline]);
|
||||||
|
@ -69,7 +69,7 @@ fn generate_test(fn_name: &str, doc: &str) -> String {
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut tests = String::new();
|
let mut tests = String::new();
|
||||||
for (i, line) in doc.split("\n").enumerate() {
|
for (i, line) in doc.split('\n').enumerate() {
|
||||||
let line = line.trim();
|
let line = line.trim();
|
||||||
if line.is_empty() {
|
if line.is_empty() {
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue