From 03cd34fb5407faf9051839cfab9705c97e1b3acc Mon Sep 17 00:00:00 2001 From: Robin Martijn Date: Tue, 22 Oct 2019 07:00:28 +0200 Subject: [PATCH] examples: use is_letter() method --- examples/word_counter/word_counter.v | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/examples/word_counter/word_counter.v b/examples/word_counter/word_counter.v index d6c0b951c1..7921584d40 100644 --- a/examples/word_counter/word_counter.v +++ b/examples/word_counter/word_counter.v @@ -61,19 +61,13 @@ fn filter_word(word string) string { return '' } mut i := 0 - for i < word.len && !is_letter(word[i]) { + for i < word.len && !word[i].is_letter() { i++ } start := i - for i < word.len && is_letter(word[i]) { + for i < word.len && word[i].is_letter() { i++ } end := i return word.substr(start, end) } - -// TODO remove once it's possible to call word[i].is_letter() -fn is_letter(c byte) bool { - return c.is_letter() -} -