From 6a912202e40a685d3540069f035cb91f402c27c5 Mon Sep 17 00:00:00 2001 From: Philippe Pittoli Date: Fri, 3 Feb 2023 05:36:04 +0100 Subject: [PATCH] Crystal bindings: removing a useless CBOR function. --- zig-impl/crystal/some-crystal-app/src/cbor.cr | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/zig-impl/crystal/some-crystal-app/src/cbor.cr b/zig-impl/crystal/some-crystal-app/src/cbor.cr index 5dec5e9..11deb80 100644 --- a/zig-impl/crystal/some-crystal-app/src/cbor.cr +++ b/zig-impl/crystal/some-crystal-app/src/cbor.cr @@ -1,4 +1,5 @@ require "cbor" +require "./main.cr" # IPC::CBOR is the root class for all exchanged messages (using CBOR). # IPC::CBOR inherited classes have a common 'type' class attribute, @@ -42,19 +43,6 @@ class IPC end end -# CAUTION: Only use this method on an Array(IPC::CBOR.class) -class Array(T) - def parse_ipc_cbor(message : IPC::Message) : IPC::CBOR? - message_type = find &.type.==(message.utype) - - if message_type.nil? - raise "invalid message type (#{message.utype})" - end - - message_type.from_cbor message.payload - end -end - # CAUTION: only use this method on an Array(IPC::CBOR.class). class Array(T) def parse_ipc_cbor(message : IPCMessage::TypedMessage) : IPC::CBOR?