Skip to content

Commit

Permalink
fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
dryajov committed Nov 14, 2023
1 parent 12b5922 commit 87e3806
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 33 deletions.
22 changes: 10 additions & 12 deletions codex/erasure/backend.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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.} =

Check warning on line 33 in codex/erasure/backend.nim

View check run for this annotation

Codecov / codecov/patch

codex/erasure/backend.nim#L33

Added line #L33 was not covered by tests
## 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,

Check warning on line 41 in codex/erasure/backend.nim

View check run for this annotation

Codecov / codecov/patch

codex/erasure/backend.nim#L41

Added line #L41 was not covered by tests
recovered: var openArray[seq[byte]]): Result[void, cstring] {.base.} =
## decode buffers using a backend
##
##
raiseAssert("not implemented!")
38 changes: 17 additions & 21 deletions codex/erasure/backends/leopard.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 =
Expand All @@ -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,
Expand Down

0 comments on commit 87e3806

Please sign in to comment.