Simplify some report helpers

This commit is contained in:
Richard Feldman 2020-04-03 00:47:21 -04:00
parent bb2ececda4
commit 3313ad05fa

View file

@ -195,21 +195,19 @@ pub enum ReportText {
} }
pub fn plain_text(str: &str) -> ReportText { pub fn plain_text(str: &str) -> ReportText {
use ReportText::*; ReportText::Plain(Box::from(str))
Plain(Box::from(str))
} }
pub fn em_text(str: &str) -> ReportText { pub fn em_text(str: &str) -> ReportText {
use ReportText::*; ReportText::EmText(Box::from(str))
}
EmText(Box::from(str)) pub fn code_text(str: &str) -> ReportText {
ReportText::Code(Box::from(str))
} }
pub fn url(str: &str) -> ReportText { pub fn url(str: &str) -> ReportText {
use ReportText::*; ReportText::Url(Box::from(str))
Url(Box::from(str))
} }
pub fn with_indent(n: usize, report_text: ReportText) -> ReportText { pub fn with_indent(n: usize, report_text: ReportText) -> ReportText {