docx_reader/reader/attributes/
indent_level.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::str::FromStr;

use xml::attribute::OwnedAttribute;

use super::super::errors::*;

pub fn read_indent_level(attrs: &[OwnedAttribute]) -> Result<usize, ReaderError> {
	let mut l = 0;
	for a in attrs {
		let local_name = &a.name.local_name;
		if local_name == "ilvl" {
			l = usize::from_str(&a.value)?;
		}
	}
	Ok(l)
}