diff options
| author | Philipp A | 2018-11-24 17:11:24 +0100 | 
|---|---|---|
| committer | Philipp A | 2018-11-24 17:11:24 +0100 | 
| commit | 0a6d381d8d4f860eeaba49d3c79ac75afc6d4763 (patch) | |
| tree | 669f8a6e5990237405a51ca3c56aa90d570e5fa3 | |
| parent | 3bde67feadf75ba8a82c9d6e59580627c1c3854f (diff) | |
| download | rust-rst-0a6d381d8d4f860eeaba49d3c79ac75afc6d4763.tar.bz2 | |
Make use of new From impl
| -rw-r--r-- | src/parser/conversion.rs | 13 | 
1 files changed, 3 insertions, 10 deletions
| diff --git a/src/parser/conversion.rs b/src/parser/conversion.rs index 5fc9605..22a6ebe 100644 --- a/src/parser/conversion.rs +++ b/src/parser/conversion.rs @@ -32,21 +32,14 @@ fn convert_ssubel(pair: Pair<Rule>) -> Result<c::StructuralSubElement, Error> {      // TODO: This is just a proof of concep. Keep closely to DTD in final version!      match pair.as_rule() {          Rule::title => Ok(convert_title(pair).into()), -        Rule::paragraph => Ok(to_ssub(e::Paragraph::with_children(vec![pair.as_str().into()]))), -        Rule::target => Ok(to_ssub(convert_target(pair)?)), -        Rule::admonition_gen => Ok(to_ssub(convert_admonition_gen(pair)?)), +        Rule::paragraph => Ok(e::Paragraph::with_children(vec![pair.as_str().into()]).into()), +        Rule::target => Ok(convert_target(pair)?.into()), +        Rule::admonition_gen => Ok(convert_admonition_gen(pair)?.into()),          rule => Err(ConversionError::UnknownRuleError { rule }.into()),      }  } -fn to_ssub<E>(elem: E) -> c::StructuralSubElement where E: Into<c::BodyElement> { -    let belm: c::BodyElement = elem.into(); -    let sstruc: c::SubStructure = belm.into(); -    sstruc.into() -} - -  fn convert_title(pair: Pair<Rule>) -> e::Title {      let mut title: Option<&str> = None;      let mut _adornment_char: Option<char> = None; | 
