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

document uucore::Args #5068

This commit is contained in:
n4n5 2024-06-30 22:51:19 +02:00
parent 96fa8e9480
commit 8605170628
No known key found for this signature in database
GPG key ID: 79414EADC6D4B457

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> {