ctucx.git: nimgit

[nimlang] nim-wrapper for libgit2

commit 847719ba79186611709a0c46cea41d83578dbda1
parent ac7f5641f8cfb1d66d48d8388828f9e1f73d2714
Author: Leah (ctucx) <leah@ctu.cx>
Date: Thu, 18 Mar 2021 01:42:13 +0100

utils.nim: cleanup
1 file changed, 8 insertions(+), 16 deletions(-)
M
nimgit/utils.nim
|
24
++++++++----------------
diff --git a/nimgit/utils.nim b/nimgit/utils.nim
@@ -20,22 +20,14 @@ proc parseGitSignature* (signature: ptr git_signature): GitSignature =
 proc filemodeStr* (m: int): string =
   var mode = align("", sizeof(m), '-')
 
-  if S_ISREG(cast[Mode](m)):
-    mode[0] = '-'
-  elif S_ISBLK(cast[Mode](m)):
-    mode[0] = 'b';
-  elif S_ISCHR(cast[Mode](m)):
-    mode[0] = 'c';
-  elif S_ISDIR(cast[Mode](m)):
-    mode[0] = 'd';
-  elif S_ISFIFO(cast[Mode](m)):
-    mode[0] = 'p';
-  elif S_ISLNK(cast[Mode](m)):
-    mode[0] = 'l';
-  elif S_ISSOCK(cast[Mode](m)):
-    mode[0] = 's';
-  else:
-    mode[0] = '?';
+  if S_ISREG(cast[Mode](m)):    mode[0] = '-'
+  elif S_ISBLK(cast[Mode](m)):  mode[0] = 'b'
+  elif S_ISCHR(cast[Mode](m)):  mode[0] = 'c'
+  elif S_ISDIR(cast[Mode](m)):  mode[0] = 'd'
+  elif S_ISFIFO(cast[Mode](m)): mode[0] = 'p'
+  elif S_ISLNK(cast[Mode](m)):  mode[0] = 'l'
+  elif S_ISSOCK(cast[Mode](m)): mode[0] = 's'
+  else:                         mode[0] = '?'
 
 
   if cast[bool](m and S_IRUSR): mode[1] = 'r'