From 44c5d9d085075eaa12832f4d501ce7f2aff2b551 Mon Sep 17 00:00:00 2001 From: Cameron Ross Date: Sun, 22 Apr 2018 18:35:07 -0300 Subject: [PATCH] make Queue fully @safe to use --- source/dyaml/queue.d | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/dyaml/queue.d b/source/dyaml/queue.d index 8905b77..9ce87b9 100644 --- a/source/dyaml/queue.d +++ b/source/dyaml/queue.d @@ -99,7 +99,7 @@ struct Queue(T) } /// Push new item to the queue. - void push(T item) @trusted nothrow + void push(T item) @safe nothrow { Node* newLast = newNode(item, null); if(last_ !is null) { last_.next_ = newLast; } @@ -109,7 +109,7 @@ struct Queue(T) } /// Insert a new item putting it to specified index in the linked list. - void insert(T item, const size_t idx) @trusted nothrow + void insert(T item, const size_t idx) @safe nothrow in { assert(idx <= length_); @@ -136,7 +136,7 @@ struct Queue(T) } /// Return the next element in the queue and remove it. - T pop() @trusted nothrow + T pop() @safe nothrow in { assert(!empty, "Trying to pop an element from an empty queue");