Remove unused boxes vector
This commit is contained in:
parent
4483980285
commit
a573d143a2
2 changed files with 0 additions and 27 deletions
|
|
@ -74,7 +74,6 @@ pub struct State<'a> {
|
|||
cm: Option<&'a SourceMap>,
|
||||
comments: Option<Vec<comments::Comment>>,
|
||||
cur_cmnt: usize,
|
||||
boxes: Vec<pp::Breaks>,
|
||||
ann: &'a (dyn PpAnn + 'a),
|
||||
}
|
||||
|
||||
|
|
@ -83,10 +82,6 @@ impl<'a> PrintState<'a> for State<'a> {
|
|||
&mut self.s
|
||||
}
|
||||
|
||||
fn boxes(&mut self) -> &mut Vec<pp::Breaks> {
|
||||
&mut self.boxes
|
||||
}
|
||||
|
||||
fn comments(&mut self) -> &mut Option<Vec<comments::Comment>> {
|
||||
&mut self.comments
|
||||
}
|
||||
|
|
@ -141,7 +136,6 @@ impl<'a> State<'a> {
|
|||
cm: Some(cm),
|
||||
comments,
|
||||
cur_cmnt: 0,
|
||||
boxes: Vec::new(),
|
||||
ann,
|
||||
}
|
||||
}
|
||||
|
|
@ -157,7 +151,6 @@ pub fn to_string<F>(ann: &dyn PpAnn, f: F) -> String
|
|||
cm: None,
|
||||
comments: None,
|
||||
cur_cmnt: 0,
|
||||
boxes: Vec::new(),
|
||||
ann,
|
||||
};
|
||||
f(&mut printer);
|
||||
|
|
@ -175,7 +168,6 @@ pub fn visibility_qualified<S: Into<Cow<'static, str>>>(vis: &hir::Visibility, w
|
|||
|
||||
impl<'a> State<'a> {
|
||||
pub fn cbox(&mut self, u: usize) {
|
||||
self.boxes.push(pp::Breaks::Consistent);
|
||||
self.s.cbox(u);
|
||||
}
|
||||
|
||||
|
|
@ -226,13 +218,6 @@ impl<'a> State<'a> {
|
|||
self.bclose_(span, indent_unit)
|
||||
}
|
||||
|
||||
pub fn in_cbox(&self) -> bool {
|
||||
match self.boxes.last() {
|
||||
Some(&last_box) => last_box == pp::Breaks::Consistent,
|
||||
None => false,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn space_if_not_bol(&mut self) {
|
||||
if !self.is_bol() {
|
||||
self.s.space();
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@ pub struct State<'a> {
|
|||
cm: Option<&'a SourceMap>,
|
||||
comments: Option<Vec<comments::Comment>>,
|
||||
cur_cmnt: usize,
|
||||
boxes: Vec<pp::Breaks>,
|
||||
ann: &'a (dyn PpAnn+'a),
|
||||
is_expanded: bool
|
||||
}
|
||||
|
|
@ -113,7 +112,6 @@ impl<'a> State<'a> {
|
|||
cm: Some(cm),
|
||||
comments,
|
||||
cur_cmnt: 0,
|
||||
boxes: Vec::new(),
|
||||
ann,
|
||||
is_expanded,
|
||||
}
|
||||
|
|
@ -130,7 +128,6 @@ pub fn to_string<F>(f: F) -> String where
|
|||
cm: None,
|
||||
comments: None,
|
||||
cur_cmnt: 0,
|
||||
boxes: Vec::new(),
|
||||
ann: &NoAnn,
|
||||
is_expanded: false
|
||||
};
|
||||
|
|
@ -426,7 +423,6 @@ fn visibility_qualified(vis: &ast::Visibility, s: &str) -> String {
|
|||
|
||||
pub trait PrintState<'a> {
|
||||
fn writer(&mut self) -> &mut pp::Printer<'a>;
|
||||
fn boxes(&mut self) -> &mut Vec<pp::Breaks>;
|
||||
fn comments(&mut self) -> &mut Option<Vec<comments::Comment>>;
|
||||
fn cur_cmnt(&mut self) -> &mut usize;
|
||||
|
||||
|
|
@ -466,17 +462,14 @@ pub trait PrintState<'a> {
|
|||
|
||||
// "raw box"
|
||||
fn rbox(&mut self, u: usize, b: pp::Breaks) {
|
||||
self.boxes().push(b);
|
||||
self.writer().rbox(u, b)
|
||||
}
|
||||
|
||||
fn ibox(&mut self, u: usize) {
|
||||
self.boxes().push(pp::Breaks::Inconsistent);
|
||||
self.writer().ibox(u);
|
||||
}
|
||||
|
||||
fn end(&mut self) {
|
||||
self.boxes().pop().unwrap();
|
||||
self.writer().end()
|
||||
}
|
||||
|
||||
|
|
@ -763,10 +756,6 @@ impl<'a> PrintState<'a> for State<'a> {
|
|||
&mut self.s
|
||||
}
|
||||
|
||||
fn boxes(&mut self) -> &mut Vec<pp::Breaks> {
|
||||
&mut self.boxes
|
||||
}
|
||||
|
||||
fn comments(&mut self) -> &mut Option<Vec<comments::Comment>> {
|
||||
&mut self.comments
|
||||
}
|
||||
|
|
@ -778,7 +767,6 @@ impl<'a> PrintState<'a> for State<'a> {
|
|||
|
||||
impl<'a> State<'a> {
|
||||
pub fn cbox(&mut self, u: usize) {
|
||||
self.boxes.push(pp::Breaks::Consistent);
|
||||
self.s.cbox(u);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue