-
Notifications
You must be signed in to change notification settings - Fork 14
docs: fix incorrect import statement in usage example #166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -140,7 +140,7 @@ pub struct Target { | |
/// NOTE: The public API should be close to the original action as much as | ||
/// possible. | ||
#[derive(Default, Clone, Setters)] | ||
#[setters(strip_option, into)] | ||
#[setters(strip_option, into, borrow_self)] | ||
pub struct Toolchain { | ||
Comment on lines
+143
to
144
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π‘ Verification agent π§© Analysis chainborrow_self on Toolchain setters β OK, but update call sites. This breaks expression-chaining into add_step/add_step_when where a Toolchain temporary is moved. Use local mut vars (see standard.rs suggestions) or add a finishing method if you prefer. π Script executed: #!/bin/bash
# Find Toolchain builder chains likely to pass &mut into add_step(_when)
rg -n -C2 -P '\.add_step(?:_when)?\(\s*Toolchain::default\(\)[\s\S]*?\)' Length of output: 536 Update call sites broken by borrow_self setters .add_step(Toolchain::default().add_stable()) (e.g. crates/gh-workflow-tailcall/src/standard.rs:206) no longer compile. Refactor these to use a local mutable let mut tc = Toolchain::default();
tc.add_stable();
job.add_step(tc); ) or add a finalizer method that consumes the builder. π€ Prompt for AI Agents
|
||
pub toolchain: Vec<Version>, | ||
#[setters(skip)] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π‘ Verification agent
π§© Analysis chain
Switch to borrow_self alters setter receivers; ensure consistency with manual by-value builders.
With
#[setters(..., borrow_self)]
, derived setters likely take a borrowed receiver (e.g., &mut self) for chaining, while methods likenightly
,args
, andadd_args*
still consumeself
. Mixed receiver styles can make chained usage awkward and may introduce breaking changes for prior one-liners that ended with a by-value method.Recommendation:
Example aligning a couple of methods (illustrative):
Run this quick check to spot potentially affected chaining patterns within the repo:
Also applies to: 38-49, 51-70
π Script executed:
Length of output: 220
Make manual builder methods borrow
&mut self
to matchborrow_self
settersManual methods (
nightly
,args
,add_arg*
) still consume and returnself
, breaking chained calls (e.g. line 228 incrates/gh-workflow-tailcall/src/standard.rs
). Convert them tofn nightly(&mut self) -> &mut Self
(and similarly forargs
,add_arg
,add_args
) to align with theborrow_self
style, or revert theborrow_self
option if you need to preserve the by-value chaining semantics.π€ Prompt for AI Agents