@@ -165,20 +165,20 @@ enum IndentStyle {
165165}
166166
167167#[ derive( Clone , Copy , Default , PartialEq ) ]
168- pub struct BreakToken {
168+ pub ( crate ) struct BreakToken {
169169 offset : isize ,
170170 blank_space : isize ,
171171 pre_break : Option < char > ,
172172}
173173
174174#[ derive( Clone , Copy , PartialEq ) ]
175- pub struct BeginToken {
175+ pub ( crate ) struct BeginToken {
176176 indent : IndentStyle ,
177177 breaks : Breaks ,
178178}
179179
180- #[ derive( Clone , PartialEq ) ]
181- pub enum Token {
180+ #[ derive( PartialEq ) ]
181+ pub ( crate ) enum Token {
182182 // In practice a string token contains either a `&'static str` or a
183183 // `String`. `Cow` is overkill for this because we never modify the data,
184184 // but it's more convenient than rolling our own more specialized type.
@@ -229,7 +229,6 @@ pub struct Printer {
229229 last_printed : Option < Token > ,
230230}
231231
232- #[ derive( Clone ) ]
233232struct BufEntry {
234233 token : Token ,
235234 size : isize ,
@@ -251,16 +250,16 @@ impl Printer {
251250 }
252251 }
253252
254- pub fn last_token ( & self ) -> Option < & Token > {
253+ pub ( crate ) fn last_token ( & self ) -> Option < & Token > {
255254 self . last_token_still_buffered ( ) . or_else ( || self . last_printed . as_ref ( ) )
256255 }
257256
258- pub fn last_token_still_buffered ( & self ) -> Option < & Token > {
257+ pub ( crate ) fn last_token_still_buffered ( & self ) -> Option < & Token > {
259258 self . buf . last ( ) . map ( |last| & last. token )
260259 }
261260
262261 /// Be very careful with this!
263- pub fn replace_last_token_still_buffered ( & mut self , token : Token ) {
262+ pub ( crate ) fn replace_last_token_still_buffered ( & mut self , token : Token ) {
264263 self . buf . last_mut ( ) . unwrap ( ) . token = token;
265264 }
266265
@@ -314,7 +313,7 @@ impl Printer {
314313 }
315314 }
316315
317- pub fn offset ( & mut self , offset : isize ) {
316+ pub ( crate ) fn offset ( & mut self , offset : isize ) {
318317 if let Some ( BufEntry { token : Token :: Break ( token) , .. } ) = & mut self . buf . last_mut ( ) {
319318 token. offset += offset;
320319 }
0 commit comments