docx_rs/reader/attributes/
indent_level.rs

1use std::str::FromStr;
2
3use xml::attribute::OwnedAttribute;
4
5use super::super::errors::*;
6
7pub fn read_indent_level(attrs: &[OwnedAttribute]) -> Result<usize, ReaderError> {
8    let mut l = 0;
9    for a in attrs {
10        let local_name = &a.name.local_name;
11        if local_name == "ilvl" {
12            l = usize::from_str(&a.value)?;
13        }
14    }
15    Ok(l)
16}