1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 19:17:43 +00:00

Merge pull request #6515 from Its-Just-Nans/document-args

document uucore::Args #5068
This commit is contained in:
Sylvestre Ledru 2024-06-30 23:09:12 +02:00 committed by GitHub
commit ff389491cc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -181,6 +181,10 @@ pub fn execution_phrase() -> &'static str {
&EXECUTION_PHRASE
}
/// Args contains arguments passed to the utility.
/// It is a trait that extends `Iterator<Item = OsString>`.
/// It provides utility functions to collect the arguments into a `Vec<String>`.
/// The collected `Vec<String>` can be lossy or ignore invalid encoding.
pub trait Args: Iterator<Item = OsString> + Sized {
/// Collects the iterator into a `Vec<String>`, lossily converting the `OsString`s to `Strings`.
fn collect_lossy(self) -> Vec<String> {