From ff04de52da1ad1371b9727807d91cca4486b82e1 Mon Sep 17 00:00:00 2001 From: Marcin Czenko Date: Wed, 12 Mar 2025 02:59:45 +0100 Subject: [PATCH] moves initializer around to prevent circ deps --- codex/manifest/coders.nim | 5 +++++ codex/manifest/manifest.nim | 6 ------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/codex/manifest/coders.nim b/codex/manifest/coders.nim index 30e0c7ca..63ab19cd 100644 --- a/codex/manifest/coders.nim +++ b/codex/manifest/coders.nim @@ -258,3 +258,8 @@ func decode*(_: type Manifest, blk: Block): ?!Manifest = return failure "Cid not a manifest codec" Manifest.decode(blk.data) + +func new*(T: type Manifest, data: openArray[byte]): ?!Manifest = + ## Create a manifest instance from given data + ## + Manifest.decode(data) diff --git a/codex/manifest/manifest.nim b/codex/manifest/manifest.nim index 93e8a69e..5b28aaaa 100644 --- a/codex/manifest/manifest.nim +++ b/codex/manifest/manifest.nim @@ -366,9 +366,3 @@ func new*( filename: manifest.filename, mimetype: manifest.mimetype, ) - -func new*(T: type Manifest, data: openArray[byte]): ?!Manifest = - ## Create a manifest instance from given data - ## - - Manifest.decode(data)