Skip to content

Add query macro docs#543

Open
ElijahAhianyo wants to merge 12 commits intomasterfrom
elijah/query-macro-docs
Open

Add query macro docs#543
ElijahAhianyo wants to merge 12 commits intomasterfrom
elijah/query-macro-docs

Conversation

@ElijahAhianyo
Copy link
Copy Markdown
Contributor

@ElijahAhianyo ElijahAhianyo commented Apr 5, 2026

Description

Adds documentation for query! macro

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Refactor / cleanup
  • Performance improvement
  • Other (describe above)

Checklist

  • I've read the contributing guide
  • Tests pass locally (just test-all)
  • Code passes clippy (just clippy)
  • Code is properly formatted (cargo fmt)
  • New tests added (regression test for bugs, coverage for new features)
  • Documentation (both code and site) updated (if applicable)

@github-actions github-actions Bot added the C-macros Crate: cot-macros label Apr 5, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 5, 2026

🐰 Bencher Report

Branchelijah/query-macro-docs
Testbedgithub-ubuntu-latest
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
milliseconds (ms)
(Result Δ%)
Upper Boundary
milliseconds (ms)
(Limit %)
empty_router/empty_router📈 view plot
🚷 view threshold
6.54 ms
(+7.53%)Baseline: 6.08 ms
7.39 ms
(88.41%)
json_api/json_api📈 view plot
🚷 view threshold
1.17 ms
(+10.35%)Baseline: 1.06 ms
1.26 ms
(92.57%)
nested_routers/nested_routers📈 view plot
🚷 view threshold
1.08 ms
(+10.90%)Baseline: 0.98 ms
1.15 ms
(93.76%)
single_root_route/single_root_route📈 view plot
🚷 view threshold
1.04 ms
(+10.99%)Baseline: 0.94 ms
1.12 ms
(93.07%)
single_root_route_burst/single_root_route_burst📈 view plot
🚷 view threshold
17.43 ms
(-1.42%)Baseline: 17.68 ms
21.08 ms
(82.67%)
🐰 View full continuous benchmarking report in Bencher

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
rust 90.08% <ø> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
cot-macros/src/lib.rs 94.84% <ø> (ø)
cot-macros/src/query.rs 73.49% <ø> (+3.72%) ⬆️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ElijahAhianyo ElijahAhianyo requested review from m4tx and seqre April 5, 2026 13:12
Comment thread cot-macros/src/lib.rs
Comment thread cot-macros/src/lib.rs
Comment thread cot-macros/src/lib.rs Outdated
Comment thread cot-macros/src/lib.rs Outdated
Comment thread cot-macros/src/lib.rs Outdated
Comment thread cot-macros/src/lib.rs
Comment thread cot-macros/src/lib.rs
@github-actions github-actions Bot added the C-lib Crate: cot (main library crate) label Apr 15, 2026
@ElijahAhianyo ElijahAhianyo force-pushed the elijah/query-macro-docs branch from cdea9fd to 377b744 Compare April 15, 2026 06:16
@ElijahAhianyo ElijahAhianyo requested a review from seqre April 15, 2026 07:01
Comment thread cot-macros/src/query.rs
Comment on lines -37 to -40
if let Some(tokens) = expr.as_tokens() {
return tokens;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reasoning behind removing this?

Comment thread cot-macros/src/lib.rs
Comment on lines +359 to +361
/// [`Query`]: query/struct.Query.html
/// [`Query::get`]: query/Struct.Query.html#method.get
/// [`Query::all`]: query/Struct.Query.html#method.all
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can always move these docs into the main crate instead to avoid these hardcoded links. Does that make sense?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I get this. Where in the main crate will this be moved?
The model (and other) macro docs live in the cot-macro crate and are then referenced in the main crate. Does this move from that idea?

Copy link
Copy Markdown
Member

@m4tx m4tx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but please have a look at my comments!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-lib Crate: cot (main library crate) C-macros Crate: cot-macros

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants