From 6d61e0c46d33b917438386191e1e11351359abac Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Fri, 15 May 2026 22:21:56 +0800 Subject: Inline `strip_all_flags` and simplify `ShellContext` methods Simplify `strip_all_flags` by using `Vec::retain` instead of reallocating. Update doc examples to use `ShellContext` methods directly instead of the now-removed `ShellContextHelper`. Rename `as_picker` to `to_picker` for consistency with Rust conventions. Mark doc tests as `ignore` and add necessary imports. --- mingling/src/parser/args.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'mingling/src/parser/args.rs') diff --git a/mingling/src/parser/args.rs b/mingling/src/parser/args.rs index 4e8ee1b..2dc0feb 100644 --- a/mingling/src/parser/args.rs +++ b/mingling/src/parser/args.rs @@ -168,11 +168,7 @@ impl Argument { /// This method filters out all command-line style flags from the arguments, /// returning a new `Argument` instance containing only non-flag arguments. pub fn strip_all_flags(mut self) -> Self { - self.vec = self - .vec - .into_iter() - .filter(|f| !f.starts_with('-')) - .collect(); + self.vec.retain(|f| !f.starts_with('-')); self } } -- cgit