docx_reader/documents/elements/
delete_text.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct DeleteText {
	text: String,
	preserve_space: bool,
}

impl DeleteText {
	pub fn new(text: impl Into<String>) -> DeleteText {
		DeleteText {
			text: text.into(),
			preserve_space: true,
		}
	}

	pub(crate) fn without_escape(text: impl Into<String>) -> DeleteText {
		DeleteText {
			text: text.into(),
			preserve_space: true,
		}
	}
}