update docstring
This commit is contained in:
parent
b8559519ca
commit
6204a06cbc
|
@ -75,7 +75,7 @@ features = ["extension-module"]
|
|||
|
||||
```rust
|
||||
#![feature(proc_macro)]
|
||||
#![macro_use] extern crate pyo3;
|
||||
#[macro_use] extern crate pyo3;
|
||||
|
||||
use pyo3::{py, PyResult, Python, PyModule};
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ pub fn py3_init(fnname: &syn::Ident, name: &String) -> Tokens {
|
|||
pub unsafe extern "C" fn #cb_name() -> *mut ::pyo3::ffi::PyObject {
|
||||
use std;
|
||||
extern crate pyo3 as _pyo3;
|
||||
use pyo3::IntoPyPointer;
|
||||
|
||||
static mut MODULE_DEF: _pyo3::ffi::PyModuleDef = _pyo3::ffi::PyModuleDef_INIT;
|
||||
// We can't convert &'static str to *const c_char within a static initializer,
|
||||
|
|
|
@ -66,11 +66,11 @@
|
|||
//! # Example
|
||||
//! ```
|
||||
//! #![feature(proc_macro)]
|
||||
//! #![macro_use] extern crate pyo3;
|
||||
//! #[macro_use] extern crate pyo3;
|
||||
//! use pyo3::{py, Python, PyResult, PyObject, PyModule};
|
||||
//!
|
||||
//! #[py::modinit(hello)]
|
||||
//! fn init_module(py: Python, m: &PyModule) {
|
||||
//! fn init_module(py: Python, m: &PyModule) -> PyResult<()> {
|
||||
//! m.add(py, "__doc__", "Module documentation string")?;
|
||||
//! m.add(py, "run", py_fn!(py, run()))?;
|
||||
//! Ok(())
|
||||
|
|
Loading…
Reference in New Issue