fix: struct typos

This commit is contained in:
Gustavo "Guz" L. de Mello
2024-04-01 16:56:15 -03:00
parent 82488606f8
commit a7b444a17f
2 changed files with 12 additions and 13 deletions

View File

@@ -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<Ast>>) -> Result<RefCell<NPF>
}
});
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

View File

@@ -71,8 +71,8 @@ pub mod content_types {
r#type: &'a str,
pub text: String,
pub subtype: Option<text::Subtypes>,
pub ident_level: Option<u8>,
pub formating: Option<Vec<text::Formatting>>,
pub indent_level: Option<u8>,
pub formatting: Option<Vec<text::Formatting>>,
}
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,
}
}
}