File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 1- struct SimpleQueue < T > {
1+ pub ( crate ) struct SimpleQueue < T > {
22 payload : Vec < T > ,
33 pos : usize ,
44}
55
66impl < T > SimpleQueue < T > {
7- fn reserve ( & mut self , n : usize ) {
7+ pub ( crate ) fn reserve ( & mut self , n : usize ) {
88 if n > self . payload . len ( ) {
99 self . payload . reserve ( n - self . payload . len ( ) ) ;
1010 }
1111 }
1212
13- fn size ( & self ) -> usize {
13+ pub ( crate ) fn size ( & self ) -> usize {
1414 self . payload . len ( ) - self . pos
1515 }
1616
17- fn empty ( & self ) -> bool {
17+ pub ( crate ) fn empty ( & self ) -> bool {
1818 self . pos == self . payload . len ( )
1919 }
2020
21- fn push ( & mut self , t : T ) {
21+ pub ( crate ) fn push ( & mut self , t : T ) {
2222 self . payload . push ( t) ;
2323 }
2424
2525 // Do we need mutable version?
26- fn front ( & self ) -> & T {
26+ pub ( crate ) fn front ( & self ) -> & T {
2727 & self . payload [ self . pos ]
2828 }
2929
30- fn clear ( & mut self ) {
30+ pub ( crate ) fn clear ( & mut self ) {
3131 self . payload . clear ( ) ;
3232 self . pos = 0 ;
3333 }
3434
35- fn pop ( & mut self ) {
35+ pub ( crate ) fn pop ( & mut self ) {
3636 self . pos += 1 ;
3737 }
3838}
You can’t perform that action at this time.
0 commit comments