From 459d696128078b8dd8d3bf1305e166f7fc4d8520 Mon Sep 17 00:00:00 2001 From: Roman Vishnevskii Date: Sat, 22 Apr 2017 13:29:24 +0700 Subject: [PATCH] Codestyle fixes --- examples/todoapp/todoapp.nim | 46 ++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/examples/todoapp/todoapp.nim b/examples/todoapp/todoapp.nim index 051b6ed..81d03f9 100644 --- a/examples/todoapp/todoapp.nim +++ b/examples/todoapp/todoapp.nim @@ -8,36 +8,36 @@ type var selectedEntry = -1 filter: Filter - entriesSize: int + entriesLen: int proc getItem(key : cstring ): cstring {.importc: "localStorage.getItem"} proc setItem(key, value : cstring ) {.importc: "localStorage.setItem"} proc clearEntries() {.importc: "localStorage.clear"} -proc getEntryCstring(pos : int): cstring = - result = getItem(cstring($pos & "cstring")) - if result == cstring"null": - result = nil +proc getEntryCstring(pos: int): cstring = + result = getItem(cstring($pos & "cstring")) + if result == cstring"null": + result = nil -proc getEntryBool(pos : int): bool = - var value = getItem(cstring($pos & "bool")) - result = value == cstring"true" +proc getEntryBool(pos: int): bool = + var value = getItem(cstring($pos & "bool")) + result = value == cstring"true" -proc setEntryCstring(pos : int, value : cstring) = - setItem(cstring($pos & "cstring"), value) +proc setEntryCstring(pos: int, value: cstring) = + setItem(cstring($pos & "cstring"), value) -proc setEntryBool(pos : int, value : bool) = - var val = cstring"true" - if not value: - val = cstring"false" - setItem(cstring($pos & "bool"), val) +proc setEntryBool(pos: int, value : bool) = + var val = cstring"true" + if not value: + val = cstring"false" + setItem(cstring($pos & "bool"), val) -proc addEntry(str : cstring, bval : bool) = - setEntryCstring(entriesSize, str) - setEntryBool(entriesSize, bval) - inc entriesSize +proc addEntry(str: cstring, bval : bool) = + setEntryCstring(entriesLen, str) + setEntryBool(entriesLen, bval) + inc entriesLen -proc setEntry(pos : int, str : cstring, bval : bool) = +proc setEntry(pos: int, str: cstring, bval: bool) = setEntryCstring(pos, str) setEntryBool(pos, bval) @@ -66,7 +66,7 @@ proc onAllDone(ev: Event; n: VNode) = selectedEntry = -1 proc clearCompleted(ev: Event, n: VNode) = - for i in 0..