diff options
author | Adam Strzelecki <ono@java.pl> | 2015-09-04 23:03:56 +0200 |
---|---|---|
committer | Adam Strzelecki <ono@java.pl> | 2015-09-04 23:03:56 +0200 |
commit | 43bddf62dd982e64cd7350eabbbc5d04c5adab21 (patch) | |
tree | 30d912ddcdf47201ea5b650d8a0064949fc0472e /lib/pure/asyncfile.nim | |
parent | d68181246571de5799059cf6402f1c578cd9421c (diff) | |
download | Nim-43bddf62dd982e64cd7350eabbbc5d04c5adab21.tar.gz |
lib: Trim .nim files trailing whitespace
via OSX: find . -name '*.nim' -exec sed -i '' -E 's/[[:space:]]+$//' {} +
Diffstat (limited to 'lib/pure/asyncfile.nim')
-rw-r--r-- | lib/pure/asyncfile.nim | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/pure/asyncfile.nim b/lib/pure/asyncfile.nim index ece9b4dfb..c7b9fac18 100644 --- a/lib/pure/asyncfile.nim +++ b/lib/pure/asyncfile.nim @@ -195,10 +195,10 @@ proc read*(f: AsyncFile, size: int): Future[string] = readBuffer.setLen(res) f.offset.inc(res) retFuture.complete(readBuffer) - + if not cb(f.fd): addRead(f.fd, cb) - + return retFuture proc readLine*(f: AsyncFile): Future[string] {.async.} = @@ -222,7 +222,7 @@ proc getFilePos*(f: AsyncFile): int64 = proc setFilePos*(f: AsyncFile, pos: int64) = ## Sets the position of the file pointer that is used for read/write - ## operations. The file's first byte has the index zero. + ## operations. The file's first byte has the index zero. f.offset = pos when not defined(windows) and not defined(nimdoc): let ret = lseek(f.fd.cint, pos, SEEK_SET) @@ -291,7 +291,7 @@ proc write*(f: AsyncFile, data: string): Future[void] = retFuture.complete() else: var written = 0 - + proc cb(fd: AsyncFD): bool = result = true let remainderSize = data.len-written @@ -309,7 +309,7 @@ proc write*(f: AsyncFile, data: string): Future[void] = result = false # We still have data to write. else: retFuture.complete() - + if not cb(f.fd): addWrite(f.fd, cb) return retFuture |