Skip to content

Commit 9b18959

Browse files
committed
perf: Avoid setting module docstring twice
1 parent 85d6880 commit 9b18959

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

python/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## [Unreleased]
44

5+
### Performance
6+
7+
- Avoid setting module docstring twice
8+
59
## [0.5.0] - 2020-08-07
610

711
### Performance

python/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ use pyo3::{create_exception, exceptions, prelude::*, types::PyList, wrap_pyfunct
2525
use rayon::prelude::*;
2626
use std::borrow::Cow;
2727

28-
const MODULE_DOCSTRING: &str = "Fast CSS inlining written in Rust";
2928
const INLINE_ERROR_DOCSTRING: &str = "An error that can occur during CSS inlining";
3029

3130
create_exception!(css_inline, InlineError, exceptions::ValueError);
@@ -169,6 +168,7 @@ mod build {
169168
include!(concat!(env!("OUT_DIR"), "/built.rs"));
170169
}
171170

171+
/// Fast CSS inlining written in Rust
172172
#[pymodule]
173173
fn css_inline(py: Python, module: &PyModule) -> PyResult<()> {
174174
module.add_class::<CSSInliner>()?;
@@ -177,7 +177,6 @@ fn css_inline(py: Python, module: &PyModule) -> PyResult<()> {
177177
let inline_error = py.get_type::<InlineError>();
178178
inline_error.setattr("__doc__", INLINE_ERROR_DOCSTRING)?;
179179
module.add("InlineError", inline_error)?;
180-
module.add("__doc__", MODULE_DOCSTRING)?;
181180
module.add("__build__", pyo3_built::pyo3_built!(py, build))?;
182181
Ok(())
183182
}

0 commit comments

Comments
 (0)