From a7b444a17f4ce4d3a31fcc21f52a4f0af8eea27d Mon Sep 17 00:00:00 2001 From: "Gustavo \"Guz\" L. de Mello" Date: Mon, 1 Apr 2024 16:56:15 -0300 Subject: [PATCH] fix: struct typos --- src/convert.rs | 13 ++++++------- src/convert/npf.rs | 12 ++++++------ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/convert.rs b/src/convert.rs index d65777d..d8e190f 100644 --- a/src/convert.rs +++ b/src/convert.rs @@ -4,10 +4,8 @@ use std::{cell::RefCell, fmt::Error}; use crate::utils; mod npf; -use npf::{ - content_types::{self, text::Formatting, text::FormattingType}, - ContentType, NPF, -}; +use npf::content_types::text::{Formatting, FormattingType, Subtypes}; +use npf::{content_types, ContentType, NPF}; #[derive(clap::ValueEnum, Clone, Debug)] pub enum Formats { @@ -56,9 +54,10 @@ pub fn to_tumblr_npf<'a>(ast: &'a Node<'a, RefCell>) -> Result } }); - let mut block = - content_types::Text::from(text.borrow().trim().to_string().replace(" ", " ")); - block.formating = if formatting.borrow().len() > 0 { + let text = text.borrow().trim().to_string().replace(" ", " "); + let mut block = content_types::Text::from(text); + + block.formatting = if formatting.borrow().len() > 0 { Some(formatting.borrow().to_vec()) } else { None diff --git a/src/convert/npf.rs b/src/convert/npf.rs index a4ac654..77beef7 100644 --- a/src/convert/npf.rs +++ b/src/convert/npf.rs @@ -71,8 +71,8 @@ pub mod content_types { r#type: &'a str, pub text: String, pub subtype: Option, - pub ident_level: Option, - pub formating: Option>, + pub indent_level: Option, + pub formatting: Option>, } impl<'a> Text<'a> { pub fn new() -> Text<'a> { @@ -80,8 +80,8 @@ pub mod content_types { r#type: "text", text: String::new(), subtype: None, - ident_level: None, - formating: None, + indent_level: None, + formatting: None, } } pub fn from(str: String) -> Text<'a> { @@ -89,8 +89,8 @@ pub mod content_types { r#type: "text", text: str, subtype: None, - ident_level: None, - formating: None, + indent_level: None, + formatting: None, } } }