Box rustc_parse_format::Piece::NextArgument

This makes both variants closer together in size (previously they were
different by 208 bytes -- 16 vs 224). This may make things worse, but
it's worth a try.
This commit is contained in:
Maybe Waffle
2022-12-06 12:02:56 +00:00
parent c5351ad4dc
commit 78060cb6de
3 changed files with 44 additions and 44 deletions

View File

@@ -58,13 +58,13 @@ impl InnerOffset {
/// A piece is a portion of the format string which represents the next part
/// to emit. These are emitted as a stream by the `Parser` class.
#[derive(Copy, Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq)]
pub enum Piece<'a> {
/// A literal string which should directly be emitted
String(&'a str),
/// This describes that formatting should process the next argument (as
/// specified inside) for emission.
NextArgument(Argument<'a>),
NextArgument(Box<Argument<'a>>),
}
/// Representation of an argument specification.
@@ -244,7 +244,7 @@ impl<'a> Iterator for Parser<'a> {
} else {
self.suggest_positional_arg_instead_of_captured_arg(arg);
}
Some(NextArgument(arg))
Some(NextArgument(Box::new(arg)))
}
}
'}' => {