Skip to content

Commit

Permalink
refactor: added pragmas to several procedures
Browse files Browse the repository at this point in the history
FossilOrigin-Name: 99bbdfd99a7afb0793d666e6bfd102955c3e42af017e664397be237f13e9550c
  • Loading branch information
thindil committed Feb 6, 2024
1 parent 8e9a68a commit aff60c7
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/types.nim
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import std/[paths, tables]
# External modules imports
import norm/[model, pragmas]
import contracts

type
HelpEntry* {.tableName: "help".} = ref object of Model
Expand Down Expand Up @@ -141,18 +142,22 @@ type
varType*: VariableValType
description*: string

proc `$`*(path: Path): string =
proc `$`*(path: Path): string {.sideEffect, raises: [], tags: [],
contractual.} =
## Convert Path type to string.
##
## * path - the path variable which will be converted to string
##
## The parameter path converted to a string
return path.string
body:
return path.string

proc len*(path: Path): Natural =
proc len*(path: Path): Natural {.sideEffect, raises: [], tags: [],
contractual.} =
## Get the length of the path variable
##
## * path - the path variable which length will be count
##
## The lenght of the parameter path
return ($path).len
body:
return ($path).len

0 comments on commit aff60c7

Please sign in to comment.