Deprecate SecureBuffer#to_slice

master
Didactic Drunk 2021-06-16 19:39:15 -07:00
parent bd5e89dcd4
commit abd43f0a1e
2 changed files with 4 additions and 1 deletions

View File

@ -31,7 +31,8 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: shards install run: shards install
- name: Run tests - 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 - name: Run bulid
run: shards build -Dpreview_mt run: shards build -Dpreview_mt
- name: Run format - name: Run format

View File

@ -51,6 +51,8 @@ module Sodium
# Returns key # Returns key
# May permanently set key to readonly depending on class usage. # May permanently set key to readonly depending on class usage.
# WARNING: Not thread safe unless this object is readonly or readwrite # 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 def to_slice : Bytes
case @state case @state
when State::Noaccess, State::Wiped when State::Noaccess, State::Wiped