From 87e3806e90a6bab89ffc9110da3ee8747400de63 Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Fri, 20 Oct 2023 13:26:24 -0600 Subject: [PATCH] fix styling --- codex/erasure/backend.nim | 22 ++++++++--------- codex/erasure/backends/leopard.nim | 38 +++++++++++++----------------- 2 files changed, 27 insertions(+), 33 deletions(-) diff --git a/codex/erasure/backend.nim b/codex/erasure/backend.nim index 2fa53d680..28ecfd409 100644 --- a/codex/erasure/backend.nim +++ b/codex/erasure/backend.nim @@ -24,24 +24,22 @@ type method release*(self: Backend) {.base.} = ## release the backend - ## + ## raiseAssert("not implemented!") method encode*( - self: EncoderBackend, - buffers, - parity: var openArray[seq[byte]] -): Result[void, cstring] {.base.} = + self: EncoderBackend, + buffers, + parity: var openArray[seq[byte]]): Result[void, cstring] {.base.} = ## encode buffers using a backend - ## + ## raiseAssert("not implemented!") method decode*( - self: DecoderBackend, - buffers, - parity, - recovered: var openArray[seq[byte]] -): Result[void, cstring] {.base.} = + self: DecoderBackend, + buffers, + parity, + recovered: var openArray[seq[byte]]): Result[void, cstring] {.base.} = ## decode buffers using a backend - ## + ## raiseAssert("not implemented!") diff --git a/codex/erasure/backends/leopard.nim b/codex/erasure/backends/leopard.nim index 2051fc979..992e34da4 100644 --- a/codex/erasure/backends/leopard.nim +++ b/codex/erasure/backends/leopard.nim @@ -22,10 +22,9 @@ type decoder*: Option[LeoDecoder] method encode*( - self: LeoEncoderBackend, - data, - parity: var openArray[seq[byte]] -): Result[void, cstring] = + self: LeoEncoderBackend, + data, + parity: var openArray[seq[byte]]): Result[void, cstring] = ## Encode data using Leopard backend if parity.len == 0: @@ -43,11 +42,10 @@ method encode*( encoder.encode(data, parity) method decode*( - self: LeoDecoderBackend, - data, - parity, - recovered: var openArray[seq[byte]] -): Result[void, cstring] = + self: LeoDecoderBackend, + data, + parity, + recovered: var openArray[seq[byte]]): Result[void, cstring] = ## Decode data using given Leopard backend var decoder = @@ -71,26 +69,24 @@ method release*(self: LeoDecoderBackend) = self.decoder.get().free() proc new*( - T: type LeoEncoderBackend, - blockSize, - buffers, - parity: int -): LeoEncoderBackend = + T: type LeoEncoderBackend, + blockSize, + buffers, + parity: int): LeoEncoderBackend = ## Create an instance of an Leopard Encoder backend - ## + ## LeoEncoderBackend( blockSize: blockSize, buffers: buffers, parity: parity) proc new*( - T: type LeoDecoderBackend, - blockSize, - buffers, - parity: int -): LeoDecoderBackend = + T: type LeoDecoderBackend, + blockSize, + buffers, + parity: int): LeoDecoderBackend = ## Create an instance of an Leopard Decoder backend - ## + ## LeoDecoderBackend( blockSize: blockSize, buffers: buffers,