Merge HumanEmitter::{new,create}.

They have the same signature, and the former just calls the latter.
This commit is contained in:
Nicholas Nethercote 2024-02-29 10:17:28 +11:00
parent 880c1c585f
commit d3727413ed

View file

@ -665,11 +665,10 @@ pub(crate) struct FileWithAnnotatedLines {
impl HumanEmitter {
pub fn stderr(color_config: ColorConfig, fallback_bundle: LazyFallbackBundle) -> HumanEmitter {
let dst = from_stderr(color_config);
Self::create(dst, fallback_bundle)
Self::new(from_stderr(color_config), fallback_bundle)
}
fn create(dst: Destination, fallback_bundle: LazyFallbackBundle) -> HumanEmitter {
pub fn new(dst: Destination, fallback_bundle: LazyFallbackBundle) -> HumanEmitter {
HumanEmitter {
dst: IntoDynSyncSend(dst),
sm: None,
@ -686,10 +685,6 @@ impl HumanEmitter {
}
}
pub fn new(dst: Destination, fallback_bundle: LazyFallbackBundle) -> HumanEmitter {
Self::create(dst, fallback_bundle)
}
fn maybe_anonymized(&self, line_num: usize) -> Cow<'static, str> {
if self.ui_testing {
Cow::Borrowed(ANONYMIZED_LINE_NUM)