From abd43f0a1eefc84d5063c43a6d2a065d7761b294 Mon Sep 17 00:00:00 2001 From: Didactic Drunk <1479616+didactic-drunk@users.noreply.github.com> Date: Wed, 16 Jun 2021 19:39:15 -0700 Subject: [PATCH] Deprecate SecureBuffer#to_slice --- .github/workflows/crystal.yml | 3 ++- src/sodium/secure_buffer.cr | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/crystal.yml b/.github/workflows/crystal.yml index 473ca1b..43fee48 100644 --- a/.github/workflows/crystal.yml +++ b/.github/workflows/crystal.yml @@ -31,7 +31,8 @@ jobs: - name: Install dependencies run: shards install - name: Run tests - run: crystal spec -Dpreview_mt --order random --error-on-warnings + run: crystal spec -Dpreview_mt --order random +# run: crystal spec -Dpreview_mt --order random --error-on-warnings - name: Run bulid run: shards build -Dpreview_mt - name: Run format diff --git a/src/sodium/secure_buffer.cr b/src/sodium/secure_buffer.cr index de3f07a..13539b0 100644 --- a/src/sodium/secure_buffer.cr +++ b/src/sodium/secure_buffer.cr @@ -51,6 +51,8 @@ module Sodium # Returns key # May permanently set key to readonly depending on class usage. # WARNING: Not thread safe unless this object is readonly or readwrite + # + @[Deprecated("Use the Slice provided within a `readonly` or `readwrite` block")] def to_slice : Bytes case @state when State::Noaccess, State::Wiped