Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
tuna2134 committed May 10, 2024
1 parent 1ba2942 commit ae1fc25
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ name = "mizu"
crate-type = ["cdylib"]

[dependencies]
pyo3 = { version = "0.20.0", features = ["extension-module"] }
pyo3 = { version = "0.21.2", features = ["extension-module"] }
pulldown-cmark = "0.10.3"
6 changes: 3 additions & 3 deletions src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use pulldown_cmark::{html, Options, Parser};
/// Args:
/// options (Options): Options for parser.
#[pyclass]
#[pyo3(text_signature = "(options, loop/)")]
pub struct Mizu {
options: Options,
loop_: Option<PyObject>,
Expand Down Expand Up @@ -36,7 +35,7 @@ impl Mizu {
///
/// Args:
/// text (str): Markdown text.
#[pyo3(text_signature = "(text, /)", signature = (text))]
#[pyo3(signature = (text))]
fn parse(&self, text: &str) -> PyResult<String> {
let parser: Parser = Parser::new_ext(text, self.options);

Expand All @@ -49,6 +48,7 @@ impl Mizu {
///
/// Args:
/// text (str): Markdown text
#[pyo3(signature = (text))]
fn aioparse(&self, py: Python, text: String) -> PyResult<PyObject> {
if self.loop_.is_none() {
return Err(pyo3::exceptions::PyValueError::new_err(
Expand All @@ -71,7 +71,7 @@ impl Mizu {
}
}

fn get_options(ob: &PyAny) -> PyResult<Options> {
fn get_options(ob: &Bound<'_, PyAny>) -> PyResult<Options> {
let mut options: Options = Options::empty();
if ob.getattr("tables")?.extract::<bool>()? {
options.insert(Options::ENABLE_TABLES);
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ mod core;

/// Mizu's core
#[pymodule]
fn mizu(_py: Python, m: &PyModule) -> PyResult<()> {
fn mizu(_py: Python, m: &Bound<'_, PyModule>) -> PyResult<()> {
m.add_class::<core::Mizu>()?;
Ok(())
}

0 comments on commit ae1fc25

Please sign in to comment.