Skip to content
This repository was archived by the owner on Aug 1, 2025. It is now read-only.

Commit d8bdbed

Browse files
authored
feat: link to rust doc in documentation (#139)
1 parent 3dee11a commit d8bdbed

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/ch00/basics/documentation.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ It's important to take the time to document your code. It will helps developers
44

55
In Cairo, you can add comments with `//`.
66

7+
### Best Practices:
8+
9+
Since Cairo 1, the community has adopted a [Rust-like documentation style](https://doc.rust-lang.org/rust-by-example/meta/doc.html).
10+
711
### Contract Interface:
812

913
In smart contracts, you will often have a trait that defines the contract's interface (with `#[starknet::interface]`).
@@ -15,10 +19,12 @@ trait IContract<TContractState> {
1519
/// High-level description of the function
1620
///
1721
/// # Arguments
22+
///
1823
/// * `arg_1` - Description of the argument
1924
/// * `arg_n` - ...
2025
///
2126
/// # Returns
27+
///
2228
/// High-level description of the return value
2329
fn do_something(ref self: TContractState, arg_1: T_arg_1) -> T_return;
2430
}

0 commit comments

Comments
 (0)