Skip to content

Commit

Permalink
fix catchErr template return type
Browse files Browse the repository at this point in the history
  • Loading branch information
inv2004 committed Oct 6, 2024
1 parent f0bc9c5 commit 7377a57
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ttop/procfs.nim
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ proc fullInfo*(prev: FullInfoRef = nil): FullInfoRef

var prevInfo = newFullInfo()

template catchErr(file: untyped, filename: string, body: untyped) =
template catchErr(file: untyped, filename: string, body: untyped): untyped =
let file: string = filename
try:
body
Expand Down Expand Up @@ -179,7 +179,7 @@ proc parseUptime(): uint =
let line = readLines(file, 1)[0]
var f: float
doAssert scanf(line, "$f", f)
return uint(float(hz) * f)
uint(float(hz) * f)

proc parseSize(str: string): uint =
let normStr = str.strip(true, false)
Expand Down Expand Up @@ -618,7 +618,7 @@ proc group*(pidsInfo: PidsTable, kernel: bool): PidsTable =
inc i

when isMainModule:
template t(body: untyped) =
template t(body: untyped): untyped =
try:
body
except CatchableError, Defect:
Expand Down

0 comments on commit 7377a57

Please sign in to comment.