From 417e46881ace86e750e1d3394e457cc6a997cc80 Mon Sep 17 00:00:00 2001 From: David Hewitt <1939362+davidhewitt@users.noreply.github.com> Date: Sat, 22 Oct 2022 12:31:39 +0100 Subject: [PATCH] fix guide build --- guide/src/function/signature.md | 4 ++-- pyo3-macros-backend/src/attributes.rs | 2 +- pyo3-macros-backend/src/utils.rs | 2 +- pyo3-macros/src/lib.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/guide/src/function/signature.md b/guide/src/function/signature.md index 2b9741c2cfe..4275a856051 100644 --- a/guide/src/function/signature.md +++ b/guide/src/function/signature.md @@ -97,10 +97,10 @@ num=-1 > Note: for keywords like `struct`, to use it as a function argument, use "raw ident" syntax `r#struct` in both the signature and the function definition: > > ```rust -> # !#[allow(unused_code)] +> # #![allow(dead_code)] > # use pyo3::prelude::*; > #[pyfunction(signature = (r#struct = "foo"))] -> fn method_with_keyword<'a>(&self, r#struct: &'a str) { +> fn function_with_keyword(r#struct: &str) { > # let _ = r#struct; > /* ... */ > } diff --git a/pyo3-macros-backend/src/attributes.rs b/pyo3-macros-backend/src/attributes.rs index 2348cd861e7..6235c7e1e2c 100644 --- a/pyo3-macros-backend/src/attributes.rs +++ b/pyo3-macros-backend/src/attributes.rs @@ -43,7 +43,7 @@ pub struct KeywordAttribute { } /// A helper type which parses the inner type via a literal string -/// e.g. LitStrValue -> parses "some::path" in quotes. +/// e.g. `LitStrValue` -> parses "some::path" in quotes. #[derive(Clone, Debug, PartialEq, Eq)] pub struct LitStrValue(pub T); diff --git a/pyo3-macros-backend/src/utils.rs b/pyo3-macros-backend/src/utils.rs index 1542e0b9c20..cbbe2b31173 100644 --- a/pyo3-macros-backend/src/utils.rs +++ b/pyo3-macros-backend/src/utils.rs @@ -44,7 +44,7 @@ pub fn is_python(ty: &syn::Type) -> bool { } } -/// If `ty` is Option, return `Some(T)`, else None. +/// If `ty` is `Option`, return `Some(T)`, else `None`. pub fn option_type_argument(ty: &syn::Type) -> Option<&syn::Type> { if let syn::Type::Path(syn::TypePath { path, .. }) = ty { let seg = path.segments.last().filter(|s| s.ident == "Option")?; diff --git a/pyo3-macros/src/lib.rs b/pyo3-macros/src/lib.rs index 1e70cf6cc62..730aaf65050 100644 --- a/pyo3-macros/src/lib.rs +++ b/pyo3-macros/src/lib.rs @@ -88,7 +88,7 @@ pub fn pyclass(attr: TokenStream, input: TokenStream) -> TokenStream { /// | [`#[classmethod]`][7] | Defines the method as a classmethod, like Python's `@classmethod` decorator.| /// | [`#[classattr]`][9] | Defines a class variable. | /// | [`#[args]`][10] | Deprecated way to define a method's default arguments and allows the function to receive `*args` and `**kwargs`. Use `#[pyo3(signature = (...))]` instead. | -/// | [`#[pyo3( | Any of the `#[pyo3]` options supported on [`macro@pyfunction`]. | +/// | [`#[pyo3( | Any of the `#[pyo3]` options supported on [`macro@pyfunction`]. | /// /// For more on creating class methods, /// see the [class section of the guide][1].