Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
160 commits
Select commit Hold shift + click to select a range
86ad967
fix: arithmetic frozen at the placeholder its operand had
Pollux12 Aug 23, 2026
1e3ae6e
fix: namespace guard reading its own empty table
Pollux12 Aug 23, 2026
54a79b7
fix: truthiness guard ignored on an unresolved field
Pollux12 Aug 23, 2026
fb01a66
fix: runtime write making a field required of a literal
Pollux12 Aug 23, 2026
13a87b4
fix: multi-return union spreading as one value
Pollux12 Aug 23, 2026
160c861
fix: delete on an unsettled receiver adding a nil member
Pollux12 Aug 23, 2026
0abee40
fix: type error reported against unreachable code
Pollux12 Aug 23, 2026
5bf75c1
fix: absence-guarded seed not counting as initialised
Pollux12 Aug 23, 2026
a1255f7
fix: branch write giving a base class its subclasses field
Pollux12 Aug 24, 2026
3eab34d
fix: latency gate failing on a file with no diagnostics
Pollux12 Aug 24, 2026
b1531ea
fix: unbounded variadic arm spreading without an arity to fill
Pollux12 Aug 24, 2026
22d79c4
fix: never carve-out answering inference as well as reports
Pollux12 Aug 24, 2026
da64716
fix: truthiness guard missing its reassignment check on two arms
Pollux12 Aug 24, 2026
0657532
perf: subtype check rescanning the type index once per level
Pollux12 Aug 24, 2026
3a5f206
fix: latency gate accepting a thinner report on cancel
Pollux12 Aug 24, 2026
89d5c7b
chore: drop a dead guard and reword three comments
Pollux12 Aug 24, 2026
4bce970
fix: alias and write racing for one member slot
Pollux12 Aug 24, 2026
9c746a5
style: reformat four files cargo fmt had missed
Pollux12 Aug 24, 2026
53213b9
docs: describe every determinism gate and require zero drift
Pollux12 Aug 24, 2026
84b4dd3
fix: consumers reading a return that settles later
Pollux12 Aug 24, 2026
1c40963
fix: decl type going to whichever write lands first
Pollux12 Aug 24, 2026
50c87c8
fix: unresolve wave reusing narrowing from before a type settled
Pollux12 Aug 24, 2026
89a2a40
perf: drop narrowing only when a value stops being undetermined
Pollux12 Aug 24, 2026
a861583
fix: a late write not reclaiming the decl slot it should own
Pollux12 Aug 24, 2026
11e628e
fix: guarded table bootstrap picked from a partial sibling set
Pollux12 Aug 24, 2026
f503812
fix: a declared pass-through losing the definition it was given
Pollux12 Aug 24, 2026
d2d3d3e
fix: loop variables read from a partial member map
Pollux12 Aug 24, 2026
3ca33d4
perf: rebuilding all narrowing when one value settled
Pollux12 Aug 24, 2026
151bdf6
fix: member initializers left reading a loop variable that settled later
Pollux12 Aug 24, 2026
1b77297
fix: a global read answered before its other realm writer landed
Pollux12 Aug 25, 2026
b29ff9a
fix: a loop over a global settling before the global did
Pollux12 Aug 25, 2026
9efcb7b
fix: guarded bootstraps picked a canonical off a half-migrated owner
Pollux12 Aug 25, 2026
91bdf96
fix: a sole visible writer decided against siblings still on the glob…
Pollux12 Aug 25, 2026
bbe4245
fix: readers of a loop variable kept the answer it had before it settled
Pollux12 Aug 25, 2026
6af13b7
fix: a slot kept whichever of an any write and a real one landed first
Pollux12 Aug 25, 2026
f26388c
fix: a defaulted parameter took the type its own default gave it only…
Pollux12 Aug 25, 2026
60cb365
fix: a read took whichever empty answer the batch had reached
Pollux12 Aug 25, 2026
791fca0
fix: a table slot lost its literal when a plain writer shared it with…
Pollux12 Aug 25, 2026
cb9285f
fix: re-adding one member wiped the writers a slot had collected
Pollux12 Aug 25, 2026
c49633c
fix: a plain reset forked the identity of a table another file bootst…
Pollux12 Aug 25, 2026
a5af200
fix: a slot several files each gave a table lost every field to bare …
Pollux12 Aug 25, 2026
3011dd7
fix: a global every plugin reassigns answered each file with another one
Pollux12 Aug 25, 2026
c5ba463
fix: a local guessed from its uses carried a nil none of its writers …
Pollux12 Aug 25, 2026
32721c3
fix: narrowing away table took the engine classes that are not tables
Pollux12 Aug 25, 2026
b4d4e1c
fix: a loop value union kept any beside the record types it stood in for
Pollux12 Aug 25, 2026
4f89c5d
fix: a nil check asked only the union arm the prefix happened to name
Pollux12 Aug 25, 2026
3e4d802
fix: assigning a table literal to the slot it merges into read as a m…
Pollux12 Aug 25, 2026
3150f27
feat: parse ldoc bracketed return groups
Pollux12 Aug 25, 2026
857549d
fix: a dynamic key read answered nil for a table only such writes fill
Pollux12 Aug 25, 2026
cb8243f
fix: a computed key gave one slot as many owners as ways to spell it
Pollux12 Aug 26, 2026
328047f
fix: an earlier write that resolved to nothing took the slot from one…
Pollux12 Aug 26, 2026
bfece74
fix: a named read of a registry another file fills came back nil-able
Pollux12 Aug 26, 2026
7561efb
fix: an isvalid guard narrowed a boolean to true instead of dropping it
Pollux12 Aug 26, 2026
bbc2b66
fix: an in-place ipairs transform left the array typed as its old ele…
Pollux12 Aug 26, 2026
7ba855e
fix: a conditional-branch slot dropped a writer homed after it was cl…
Pollux12 Aug 27, 2026
d35c44a
fix: a read settled a cross-file value before every file had shaped it
Pollux12 Aug 27, 2026
043f458
fix: preserve cross-file state during re-indexing
Pollux12 Aug 27, 2026
92e57e8
chore: remove bad test
Pollux12 Aug 27, 2026
dec553a
perf: incremental change-aware edit pipeline
Pollux12 Aug 27, 2026
75e93f6
chore: update instructions
Pollux12 Aug 27, 2026
56657d7
fix: remap Element/TableConst offsets on incremental edits
Pollux12 Aug 28, 2026
8fb9aa9
fix: make the edit fingerprint read what dependents can observe
Pollux12 Aug 28, 2026
707f4f3
fix: various issues with cross-file caches
Pollux12 Aug 28, 2026
d8fef95
chore: cleanup
Pollux12 Aug 28, 2026
f9ca6da
fix: completions instability
Pollux12 Aug 29, 2026
f9fc9b9
fix: dynamic-field visibility is function-body aware
Pollux12 Aug 29, 2026
834e7b3
perf: parallelize the settled iter-var re-derivation
Pollux12 Aug 29, 2026
d094e44
fix: a branch write is not a load-order fact
Pollux12 Aug 29, 2026
496498a
perf: resolve dynamic-field visibility state once per listing
Pollux12 Aug 29, 2026
9bc75c9
fix: apply settled iter-var writes in source order
Pollux12 Aug 29, 2026
6e2e01c
refactor: drop the settled flag from the iter-var retry
Pollux12 Aug 29, 2026
629dc05
test: isolate the progress tests from concurrent analysis
Pollux12 Aug 29, 2026
5f34eaa
test: drop the duplicated global-sink test from glua_ls
Pollux12 Aug 29, 2026
ca46070
docs: restore the comments the cleanup pass truncated
Pollux12 Aug 29, 2026
1b4d61f
fix: a guard snapshot outlived the burst that took it
Pollux12 Aug 29, 2026
180b2ff
fix: a dynamic field stayed on the range its literal left
Pollux12 Aug 29, 2026
141c998
fix: calling a value typed any answered undetermined
Pollux12 Aug 30, 2026
357d23d
docs: clarify determinism harness
Pollux12 Aug 30, 2026
6fd87b8
fix: stabilise call-site dependency indexes
Pollux12 Aug 30, 2026
f27870d
test: expand determinism index snapshots
Pollux12 Aug 30, 2026
3305fe7
perf: reduce repeated analysis index work
Pollux12 Aug 30, 2026
461b482
refactor: add position-mapped export remapping
Pollux12 Aug 30, 2026
79fdf1a
refactor: canonicalise global member ownership
Pollux12 Aug 30, 2026
17b6b9b
fix: classify computed-key writes as value evidence
Pollux12 Aug 30, 2026
0dc1c2d
fix: deduplicate rendered member keys
Pollux12 Aug 30, 2026
3deb346
fix: propagate settled member repairs
Pollux12 Aug 31, 2026
5b5a511
fix: preserve dynamic assignment ownership
Pollux12 Aug 31, 2026
0ba6d82
fix: apply GMod load edges in stable order
Pollux12 Aug 31, 2026
26382e6
fix: preserve metadata writers across reindexing
Pollux12 Aug 31, 2026
5fc8ce4
fix: order class files by stable path
Pollux12 Aug 31, 2026
66f1205
fix: keep edit indexes consistent across file changes
Pollux12 Aug 31, 2026
2dbf42c
feat: add the change-driven edit pipeline
Pollux12 Aug 31, 2026
475ff84
perf: derive network invalidations from moved references
Pollux12 Aug 31, 2026
beca80f
fix: preserve member slot arbitration after rekeying
Pollux12 Aug 31, 2026
9d4f92d
perf: use FxHash for analysis maps
Pollux12 Aug 31, 2026
9b448fe
perf: cache repeated inference lookups
Pollux12 Aug 31, 2026
892f23c
perf: share network call-site resolution
Pollux12 Aug 31, 2026
ded0912
perf: optimise union type operations
Pollux12 Aug 31, 2026
126caaf
perf: cache dynamic-field definition lookups
Pollux12 Aug 31, 2026
7735ccb
perf: skip needless flow initializer descents
Pollux12 Aug 31, 2026
5e675b8
perf: share the rayon analysis pool
Pollux12 Aug 31, 2026
be7c4b9
fix: clear invalidated ipairs transforms
Pollux12 Sep 1, 2026
3bc0d16
refactor: use one analysis stack size
Pollux12 Sep 1, 2026
4ace5b8
fix: stabilise truthiness guard reads
Pollux12 Sep 1, 2026
590ca14
refactor: remove unused widening state
Pollux12 Sep 1, 2026
17ccc19
docs: move analyser comments to their declarations
Pollux12 Sep 1, 2026
cae1ab5
refactor: clarify canonical member ownership ordering
Pollux12 Sep 1, 2026
6c392bc
docs: remove stale analyser references
Pollux12 Sep 1, 2026
5ccfffd
refactor: share the access-path walker
Pollux12 Sep 1, 2026
b3162a9
refactor: centralise workspace file ordering
Pollux12 Sep 1, 2026
673fba9
fix: keep type remaps and invalidation state consistent
Pollux12 Sep 1, 2026
0bee9bd
refactor: centralise member requirement predicates
Pollux12 Sep 1, 2026
b10b3a0
test: cover ldoc return tags
Pollux12 Sep 1, 2026
8b70c65
refactor: split index tests
Pollux12 Sep 1, 2026
0e65724
refactor: name member owner-key indexes
Pollux12 Sep 1, 2026
eea6dee
perf: scan type declarations without allocation
Pollux12 Sep 1, 2026
33920c1
docs: record determinism gate status
Pollux12 Sep 1, 2026
87648f8
refactor: name the initializer pass
Pollux12 Sep 1, 2026
5132838
refactor: sort parallel map results
Pollux12 Sep 1, 2026
ba180fa
refactor: isolate inferred guard propagation
Pollux12 Sep 1, 2026
aa35da5
fix: stabilise settled re-inference
Pollux12 Sep 1, 2026
0201b40
fix: order VGUI parent calls
Pollux12 Sep 1, 2026
7ac3586
fix: stabilise settled member and initializer inference
Pollux12 Sep 1, 2026
ae853e7
fix: preserve dynamic member inference across reindexing
Pollux12 Sep 1, 2026
b023d76
fix: stabilise incremental index dependencies
Pollux12 Sep 1, 2026
1d93017
chore: format project files
Pollux12 Sep 3, 2026
efffee2
chore: add Samply bridge helper
Pollux12 Sep 3, 2026
7bad91b
fix: stabilise incremental reindexing
Pollux12 Sep 3, 2026
9b3697d
perf: use indexed GMod metadata in analysis
Pollux12 Sep 4, 2026
9b5ebfe
perf: settle change-driven edits from export diffs
Pollux12 Sep 4, 2026
7c8afb3
fix: prevent unbound pairs generics from leaking
Pollux12 Sep 4, 2026
88ba91c
fix: refresh watched diagnostics from export changes
Pollux12 Sep 4, 2026
f0fd515
fix: converge settled replay and guard fixpoint loops
Pollux12 Sep 4, 2026
7fe6242
perf: remove unused condition-flow storage
Pollux12 Sep 6, 2026
637939d
chore: add profile-gated LSP timing
Pollux12 Sep 4, 2026
10ef550
fix: report glua_check worker failures
Pollux12 Sep 4, 2026
017681f
fix: release waiters when analysis loops die
Pollux12 Sep 4, 2026
5f6e639
perf: optimise guarded bootstrap resolution
Pollux12 Sep 5, 2026
37e0a4b
fix: guard parser and inference recursion
Pollux12 Sep 5, 2026
d54178b
fix: propagate changed names to diagnostic refresh
Pollux12 Sep 5, 2026
351ff3b
fix: replay settled global writes and computed keys
Pollux12 Sep 5, 2026
8e07f64
fix: make rowan tree management safe on small stacks
Pollux12 Sep 5, 2026
a05e317
fix: guard flow binding recursion against stack exhaustion
Pollux12 Sep 5, 2026
dc1ac6e
fix: handle doc tag tuple types
Pollux12 Sep 6, 2026
3e20c77
fix: preserve unknown values in or inference
Pollux12 Sep 6, 2026
d5d3a1b
fix: infer ipairs names
Pollux12 Sep 6, 2026
93dc0a4
fix: refresh diagnostics for watched files
Pollux12 Sep 6, 2026
fb8b708
fix: make analyzer APIs compatible
Pollux12 Sep 6, 2026
90f06a6
fix: handle nullable checks
Pollux12 Sep 6, 2026
9fbf2c0
fix: infer class members
Pollux12 Sep 6, 2026
f3e7e4e
fix: preserve edit positions
Pollux12 Sep 6, 2026
cbbfcf0
fix: debounce analysis refreshes
Pollux12 Sep 6, 2026
d6c22ec
fix: expose analysis refresh APIs
Pollux12 Sep 6, 2026
a4549ee
fix: drop ldoc return support
Pollux12 Sep 6, 2026
a0e39e5
fix: strict ipairs builtin guard
Pollux12 Sep 6, 2026
b245b29
fix: preserve alias path provenance
Pollux12 Sep 6, 2026
517f6f5
fix: remaining public std collections
Pollux12 Sep 6, 2026
641e200
fix: watcher final-delete diagnostics
Pollux12 Sep 6, 2026
df1c611
fix: rename refresh workspace and immediate paths
Pollux12 Sep 6, 2026
68602f7
Merge branch 'main' into fix/index-regressions
Pollux12 Sep 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 5 additions & 5 deletions .agents/skills/rust-best-practices/references/chapter_01.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## 1.1 Borrowing Over Cloning

Rust's ownership system encourages **borrow** (`&T`) instead of **cloning** (`T.clone()`).
Rust's ownership system encourages **borrow** (`&T`) instead of **cloning** (`T.clone()`).
> ❗ Performance recommendation

### ✅ When to `Clone`:
Expand Down Expand Up @@ -361,7 +361,7 @@ Well-written Rust code, with expressive types and good naming, often speaks for

Still, there are **moments where code alone isn't enough** - when there are performance quirks, external constraints, or non-obvious tradeoffs that require a nudge to the reader. In those cases, a concise comment can prevent hours of head-scratching or searching git history.

### ✅ Good comments
### ✅ Good comments

* Safety concerns:
```rust
Expand Down Expand Up @@ -398,8 +398,8 @@ let subgraph_tls_root_store: RootCertStore = configuration

* Wall-of-text explanations: long comments and multiline comments
```rust
// Lorem Ipsum is simply dummy text of the printing and typesetting industry.
// Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,
// Lorem Ipsum is simply dummy text of the printing and typesetting industry.
// Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,
// when an unknown printer took a galley
fn do_something_odd() {
Expand Down Expand Up @@ -480,7 +480,7 @@ There are a few gotchas when calling comments "living documentation":
* Many large comments make people avoid reading them.
* Team becomes fearful of delete irrelevant comments.

If you find a comment, **don't trust it blindly**. Read it in context. If it's wrong or outdated, fix or remove it. A misleading comment is worse than no comments at all.
If you find a comment, **don't trust it blindly**. Read it in context. If it's wrong or outdated, fix or remove it. A misleading comment is worse than no comments at all.

> Comments should bother you - they demand re-verification, just like stale tests.

Expand Down
4 changes: 2 additions & 2 deletions .agents/skills/rust-best-practices/references/chapter_02.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Potential additions elements to add:

> Example at ApolloGraphQL
>
> In the `Router` project there is a `xtask` configured for linting that can be executed with `cargo xtask lint`.
> In the `Router` project there is a `xtask` configured for linting that can be executed with `cargo xtask lint`.

## 2.3 Important Clippy Lints to Respect

Expand Down Expand Up @@ -69,7 +69,7 @@ enum Message {
```

> The fix would be:
>
>
> ```rust
> // Faster matching is preferred over size efficiency
> #[expect(clippy::large_enum_variant)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ hello_greet(Cow::Owned("Naomi".to_string()));

## 3.3 Stack vs Heap: Be size-smart!

### ✅ Good Practices
### ✅ Good Practices

* Keep small types (`impl Copy`, `usize`, `bool`, etc) **on the stack**.
* Avoid passing huge types (`> 512 bytes`) by value or transferring ownership. Prefer pass by reference (e.g. `&T` and `&mut T`).
Expand Down
54 changes: 27 additions & 27 deletions .agents/skills/rust-best-practices/references/chapter_05.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ In Rust, as in many other languages, tests often show how the functions are mean
> In the unit test name we should see the following:
> * `unit_of_work`: which *function* we are calling. The **action** that will be executed. This is often be the name of the the test `mod` where the function is being tested.
```rust
#[cfg(test)]
mod test {
mod function_name {
#[test]
fn returns_y_when_x() { ... }
}
#[cfg(test)]
mod test {
mod function_name {
#[test]
fn returns_y_when_x() { ... }
}
}
```
> * `expected_behavior`: the set of **assertions** that we need to verify that the test works.
Expand Down Expand Up @@ -83,9 +83,9 @@ mod test { // IDEs will provide a ▶️ button here
let a = setup_a_to_be_xyz();
let b = Some(-5);
let expected = MyError::Xyz;

let result = process(a, b).unwrap_err();

assert_eq!(result, expected);
}

Expand Down Expand Up @@ -124,8 +124,8 @@ mod test_thing_parser {
fn lowercase_letters_are_valid() {
assert!(
Thing::parse("abcd").is_ok(),
// Works like `eprintln, format and println` macros
"Thing parse error: {:?}",
// Works like `eprintln, format and println` macros
"Thing parse error: {:?}",
Thing::parse("abcd").unwrap_err()
);
}
Expand All @@ -141,7 +141,7 @@ mod test_thing_parser {

### Use very few, ideally one, assertion per test

When there are multiple assertions per test, it's both harder to understand the intended behavior and
When there are multiple assertions per test, it's both harder to understand the intended behavior and
often requires many iterations to fix a broken test, as you work through assertions one by one.

❌ Don't include many assertions in one test:
Expand Down Expand Up @@ -185,19 +185,19 @@ We will deep dive into docs at a later stage, so in this section we will just br

```rust
/// Helper function that adds any two numeric values together.
/// This functions reasons about which would be the correct type to parse based on the type
/// This functions reasons about which would be the correct type to parse based on the type
/// and the size of the numeric value.
///
///
/// # Examples
///
///
/// ```rust
/// # use crate_name::generic_add;
/// use num::numeric;
///
///
/// # assert_eq!(
/// generic_add(5.2, 4) // => 9.2
/// # , 9.2)
///
///
/// # assert_eq!(
/// generic_add(2, 2.0) // => 4
/// # , 4)
Expand Down Expand Up @@ -243,7 +243,7 @@ mod unit_of_work_tests {

### Integration Tests

Tests that go under the `tests/` directory, they are entirely external to your library and use the same code as any other code would use, not have access to private and crate level functions, which means they can **only test** functions on your **public API**.
Tests that go under the `tests/` directory, they are entirely external to your library and use the same code as any other code would use, not have access to private and crate level functions, which means they can **only test** functions on your **public API**.

> Their purpose is to test whether many parts of the code work together correctly, units of code that work correctly on their own could have problems when integrated.

Expand All @@ -252,14 +252,14 @@ Tests that go under the `tests/` directory, they are entirely external to your l
* if testing binaries, try to break **executable** and **functions** into `src/main.rs` and `src/lib.rs`, respectively.

```
├── Cargo.lock
├── Cargo.toml
├── src
│ └── lib.rs
└── tests
├── mod.rs
├── common
│ └── mod.rs
├── Cargo.lock
├── Cargo.toml
├── src
│ └── lib.rs
└── tests
├── mod.rs
├── common
│ └── mod.rs
└── integration_test.rs
```

Expand Down Expand Up @@ -341,7 +341,7 @@ Snapshot testing compares your output (text, Json, HTML, YAML, etc) against a sa
assert_snapshot!("this_is_a_named_snapshot", output);
```

* Keep snapshots small and clear.
* Keep snapshots small and clear.
```rust
// ✅ Best case:
assert_snapshot!("app_config/http", whole_app_config.http);
Expand All @@ -350,7 +350,7 @@ assert_snapshot!("app_config/http", whole_app_config.http);
assert_snapshot!("app_config", whole_app_config); // Huge object
```

> #### 🚨 Avoid snapshotting huge objects
> #### 🚨 Avoid snapshotting huge objects
> Huge objects become hard to review and reason about.

* Avoid snapshotting simple types (primitives, flat enums, small structs):
Expand Down
6 changes: 3 additions & 3 deletions .agents/skills/rust-best-practices/references/chapter_07.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Chapter 7 - Type State Pattern

Models state at compile time, preventing bugs by making illegal states unrepresentable. It takes advantage of the Rust generics and type system to create sub-types that can only be reached if a certain condition is achieved, making some operations illegal at compile time.
Models state at compile time, preventing bugs by making illegal states unrepresentable. It takes advantage of the Rust generics and type system to create sub-types that can only be reached if a certain condition is achieved, making some operations illegal at compile time.

> Recently it became the standard design pattern of Rust programming. However, it is not exclusive to Rust, as it is achievable and has inspired other languages to do the same [swift](https://swiftology.io/articles/typestate/) and [typescript](https://catchts.com/type-state).

Expand Down Expand Up @@ -141,8 +141,8 @@ impl Builder<MissingName, AgeSet> {

impl Builder<NameSet, AgeSet> {
fn build(self) -> Person {
Person {
name: self.name.unwrap_or_else(|| unreachable!("Name is guarantee to be set")),
Person {
name: self.name.unwrap_or_else(|| unreachable!("Name is guarantee to be set")),
age: self.age,
email: self.email,
}
Expand Down
10 changes: 5 additions & 5 deletions .agents/skills/rust-best-practices/references/chapter_08.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Use `///` doc comments to document:

```rust
/// Loads [`User`] profile from disk
///
///
/// # Error
/// - Returns [`MyError`] if the file is missing [`MyError::FileNotFound`].
/// - Returns [`MyError`] if the content is an invalid Json, [`MyError::InvalidJson`].
Expand All @@ -139,9 +139,9 @@ fn load_user(path: &Path) -> Result<User, MyError> {...}
```rust
/// Returns the square of the integer part of any number.
/// Square is limited to `u128`.
///
///
/// # Examples
///
///
/// ```rust
/// assert_eq!(square(4.3), 16)
/// ```
Expand Down Expand Up @@ -203,9 +203,9 @@ pub fn add(a: i32, b: i32) -> i32 {
Use `//!` when you want to document the **purpose of a module or a crate**. It is places at the top of a `lib.rs` or `mod.rs` file, for example `engine/mod.rs`:
```rust
//! This module implements a custom chess engine.
//!
//!
//! It handles board state, move generation and check detection.
//!
//!
//! # Example
//! ```
//! let board = chess::engine::Board::default();
Expand Down
4 changes: 2 additions & 2 deletions .agents/skills/rust-best-practices/references/chapter_09.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Many higher level languages hide memory management, typically **passing by value** (copy data) or **passing by reference** (reference to shared data) without worrying about allocation, heap, stack, ownership and lifetimes, it is all delegated to the garbage collector or VM. Here is a comparison on this topic between a few languages:

### 📌 Language Comparison
### 📌 Language Comparison

| Language | Value Types | Reference/Pointer Types | Async Model & Types | Manual Memory |
|------------ |------------------------------------- |----------------------------------------------------------- |---------------------------------------------------------------------------- |------------------------------ |
Expand Down Expand Up @@ -178,7 +178,7 @@ use std::{cell::OnceCell, rc::Rc};
#[derive(Debug, Default)]
struct MyStruct {
distance: usize,
root: Option<Rc<OnceCell<MyStruct>>>,
root: Option<Rc<OnceCell<MyStruct>>>,
}

fn main() {
Expand Down
Loading