navid/veins / commit

6a679de23c72

Navid M <navidmomtahen@gmail.com> · 2026-11-26

parents: 79b5392b34ec

Browse files at this commit · Download source

all: fmt solution
--- a/veins/src/cli/bookmark_cmd.sx+++ b/veins/src/cli/bookmark_cmd.sx@@ -254,13 +254,9 @@     val resolved = graph.resolve(st.handles, tx.view, rev)     val target: mut objid.Id = objid.id_none()     val mut_found: mut bool = false-    match resolved {-        some id => {-            target = copy_id(id)-            mut_found = true-        }-        none => {-        }+    if resolved is some id {+        target = copy_id(id)+        mut_found = true     }     if !mut_found {         msg.error_prefix()@@ -374,13 +370,9 @@     val existing = viewops.find_bookmark(tx.view, name)     val idx: mut usize = 0     val mut_found: mut bool = false-    match existing {-        some i2 => {-            idx = i2-            mut_found = true-        }-        none => {-        }+    if existing is some i2 {+        idx = i2+        mut_found = true     }     if !mut_found {         msg.error_prefix()@@ -534,6 +526,7 @@     store.close(st)     return 0 }+ fn usage() void = trust {     stdio.puts("usage: vn bookmark <set|list|delete> ...")     stdio.puts("")--- a/veins/src/cli/ex_cmd.sx+++ b/veins/src/cli/ex_cmd.sx@@ -201,12 +201,8 @@     )     val data_opt = files.read_all(exclude_path)     val data: mut bytes.Bytes = bytes.empty()-    match data_opt {-        some d => {-            data = d-        }-        none => {-        }+    if data_opt is some d {+        data = d     }      val additions: mut buf.Buf = buf.new(64)--- a/veins/src/cli/inf_cmd.sx+++ b/veins/src/cli/inf_cmd.sx@@ -341,7 +341,7 @@                 prev = p             }             val keep: bool = prev.lines > cur.lines-                || (prev.lines == cur.lines && bytes.Bytes.cmp(prev.ext, cur.ext) <= 0)+            || (prev.lines == cur.lines && bytes.Bytes.cmp(prev.ext, cur.ext) <= 0)             if keep {                 break             }@@ -369,7 +369,7 @@                 prev = p             }             val keep: bool = prev.commits > cur.commits-                || (prev.commits == cur.commits && bytes.Bytes.cmp(prev.name, cur.name) <= 0)+            || (prev.commits == cur.commits && bytes.Bytes.cmp(prev.name, cur.name) <= 0)             if keep {                 break             }--- a/veins/src/cli/show_cmd.sx+++ b/veins/src/cli/show_cmd.sx@@ -132,9 +132,9 @@         stdio.print("commit   {s}\n", {str.view(hex, 64)})         stdio.print("change   {s}\n", {str.view(cid.ptr, cid.len as i64)})         stdio.print("author   {s} <{s}>\n", {-            str.view(author_name.ptr, author_name.len as i64),-            str.view(author_email.ptr, author_email.len as i64)-        })+                str.view(author_name.ptr, author_name.len as i64),+                str.view(author_email.ptr, author_email.len as i64)+            })         stdio.print("date     {s}\n", {str.view(stamp.ptr, stamp.len as i64)})         stdio.print("parents  ", {})         if @len(lc.c.parents) == 0 {--- a/veins/src/core/identity.sx+++ b/veins/src/core/identity.sx@@ -1,9 +1,9 @@ /// Author/committer identity from repository config, the user config at /// `~/.local/config/veins/veins.toml`, or the environment. -val str    = use("std/string")-val os     = use("std/os")-val time   = use("std/time")+val str        = use("std/string")+val os         = use("std/os")+val time       = use("std/time") val bytes      = use("../core/bytes.sx") val prim       = use("../core/primitives.sx") val layout     = use("../store/layout.sx")--- a/veins/src/worktree/checkout.sx+++ b/veins/src/worktree/checkout.sx@@ -955,13 +955,9 @@     val target_opt = graph.resolve(store_handle.handles, v, rev)     val target: mut objid.Id = objid.id_none()     val have_target: mut bool = false-    match target_opt {-        some id => {-            target = copy_id(id)-            have_target = true-        }-        none => {-        }+    if target_opt is some id {+        target = copy_id(id)+        have_target = true     }     if !have_target {         msg.error_prefix()--- a/veins/src/worktree/pathspec.sx+++ b/veins/src/worktree/pathspec.sx@@ -38,7 +38,7 @@     if bytes.Bytes.eql(cb, root) {         result = some(bytes.empty())     } elif cb.len > root.len && bytes.Bytes.starts_with(cb, root)-        && bytes.Bytes.at(cb, root.len) == 47 {+    && bytes.Bytes.at(cb, root.len) == 47 {         result = some(bytes.Bytes.dup(bytes.Bytes.slice(cb, root.len + 1, cb.len)))     }     @free(canon as ref void)@@ -120,7 +120,7 @@         }         val result: mut option[bytes.Bytes] = none         if norm.len > root_view.len && bytes.Bytes.starts_with(norm, root_view)-            && bytes.Bytes.at(norm, root_view.len) == 47 {+        && bytes.Bytes.at(norm, root_view.len) == 47 {             result = some(bytes.Bytes.dup(bytes.Bytes.slice(norm, root_view.len + 1, norm.len)))         }         if norm.ptr != none {