summary refs log tree commit diff stats
path: root/lib/pure/streams.nim
diff options
context:
space:
mode:
authornarimiran <narimiran@disroot.org>2019-09-27 11:20:18 +0200
committernarimiran <narimiran@disroot.org>2019-09-30 13:58:13 +0200
commitdcf3181bd16bcf55aa4644a5d9ec15d8abfcb48b (patch)
tree61c5e679fab953169e46845eafff027769ea00cd /lib/pure/streams.nim
parent0ca9cc7419736d825f883a9249d949db86e3700f (diff)
downloadNim-dcf3181bd16bcf55aa4644a5d9ec15d8abfcb48b.tar.gz
[backport] run nimpretty on string stuff
Diffstat (limited to 'lib/pure/streams.nim')
-rw-r--r--lib/pure/streams.nim16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/pure/streams.nim b/lib/pure/streams.nim
index 61aa520d1..0435e1f36 100644
--- a/lib/pure/streams.nim
+++ b/lib/pure/streams.nim
@@ -897,7 +897,7 @@ proc readLine*(s: Stream, line: var TaintedString): bool =
     doAssert strm.readLine(line) == false
     doAssert line == ""
     strm.close()
-  
+
   if s.readLineImpl != nil:
     result = s.readLineImpl(s, line)
   else:
@@ -1259,7 +1259,8 @@ else:
     result.writeDataImpl = fsWriteData
     result.flushImpl = fsFlush
 
-  proc newFileStream*(filename: string, mode: FileMode = fmRead, bufSize: int = -1): owned FileStream =
+  proc newFileStream*(filename: string, mode: FileMode = fmRead,
+      bufSize: int = -1): owned FileStream =
     ## Creates a new stream from the file named `filename` with the mode `mode`.
     ##
     ## If the file cannot be opened, `nil` is returned. See the `io module
@@ -1296,7 +1297,8 @@ else:
     var f: File
     if open(f, filename, mode, bufSize): result = newFileStream(f)
 
-  proc openFileStream*(filename: string, mode: FileMode = fmRead, bufSize: int = -1): owned FileStream =
+  proc openFileStream*(filename: string, mode: FileMode = fmRead,
+      bufSize: int = -1): owned FileStream =
     ## Creates a new stream from the file named `filename` with the mode `mode`.
     ## If the file cannot be opened, an IO exception is raised.
     ##
@@ -1390,11 +1392,11 @@ when false:
     else:
       var flags: cint
       case mode
-      of fmRead:              flags = posix.O_RDONLY
-      of fmWrite:             flags = O_WRONLY or int(O_CREAT)
-      of fmReadWrite:         flags = O_RDWR or int(O_CREAT)
+      of fmRead: flags = posix.O_RDONLY
+      of fmWrite: flags = O_WRONLY or int(O_CREAT)
+      of fmReadWrite: flags = O_RDWR or int(O_CREAT)
       of fmReadWriteExisting: flags = O_RDWR
-      of fmAppend:            flags = O_WRONLY or int(O_CREAT) or O_APPEND
+      of fmAppend: flags = O_WRONLY or int(O_CREAT) or O_APPEND
       var handle = open(filename, flags)
       if handle < 0: raise newEOS("posix.open() call failed")
     result = newFileHandleStream(handle)