Skip to content

Commit

Permalink
docs: fix typos in API Reference documentation (#1015)
Browse files Browse the repository at this point in the history
* docs: fix incorrect caption for add_view code sample

Changed "Using the `@app.view` decorator" to "Using the `app.add_view` method" to more accurately describe the code sample.

* docs: fix logic error in rust code sample

Fix the `square` function's logic to square the number instead of cubing it.
  • Loading branch information
nicdgonzalez authored Nov 10, 2024
1 parent 1af681f commit 0b3162a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ The first thing you need to is to create a Rust file. Let's call it `hello_world

#[pyfunction]
fn square(n: i32) -> i32 {
n * n * n
n * n
// this is another comment
}

Expand Down
2 changes: 1 addition & 1 deletion docs_src/src/pages/documentation/api_reference/views.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ You can serve views in two ways:

<Row>
<Col>
Using an `@app.view` decorator.
Using the `app.add_view` method.
</Col>
<Col sticky>
<CodeGroup title="Request" tag="GET" label="/hello_world">
Expand Down

0 comments on commit 0b3162a

Please sign in to comment.