docx-rs 0.4.20

A .docx file writer with Rust/WebAssembly.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::str::FromStr;

use crate::reader::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)
}