File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33use std:: borrow:: Borrow ;
44use std:: cell:: UnsafeCell ;
55use std:: collections:: { HashSet , VecDeque , hash_set, vec_deque} ;
6+ use std:: fmt;
67use std:: hash:: Hash ;
78
89/// FIFO queue that never leaks references to its content
@@ -70,6 +71,13 @@ impl<T> Queue<T> {
7071 }
7172}
7273
74+ impl < T : fmt:: Debug > fmt:: Debug for Queue < T > {
75+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
76+ let inner = unsafe { & * self . 0 . get ( ) } ;
77+ inner. fmt ( f)
78+ }
79+ }
80+
7381impl < T > Default for Queue < T > {
7482 fn default ( ) -> Self {
7583 Self :: new ( )
@@ -143,6 +151,13 @@ impl<T: Eq + Hash> Set<T> {
143151 }
144152}
145153
154+ impl < T : fmt:: Debug > fmt:: Debug for Set < T > {
155+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
156+ let inner = unsafe { & * self . 0 . get ( ) } ;
157+ inner. fmt ( f)
158+ }
159+ }
160+
146161impl < T > Default for Set < T > {
147162 fn default ( ) -> Self {
148163 Self ( Default :: default ( ) )
You can’t perform that action at this time.
0 commit comments