remove 'static lifetime

This is probably an old remnant, but it is no longer necessary
This commit is contained in:
Terts Diepraam
2023-12-15 23:29:25 +01:00
parent f24edac759
commit cc9ce1ea50
5 changed files with 13 additions and 13 deletions
+1 -1
View File
@@ -88,7 +88,7 @@ impl Options<Arg> for Settings {
}
}
fn run(args: &'static [&'static str]) -> String {
fn run(args: &[&str]) -> String {
let s = Settings::default().parse(args);
let mut output = if s.caps {
s.text.to_uppercase()
+7 -7
View File
@@ -50,7 +50,7 @@ pub trait Arguments: Sized {
/// [`ArgumentIter<Self>`](ArgumentIter).
fn parse<I>(args: I) -> ArgumentIter<Self>
where
I: IntoIterator + 'static,
I: IntoIterator,
I::Item: Into<OsString>,
{
ArgumentIter::<Self>::from_args(args)
@@ -86,7 +86,7 @@ pub trait Arguments: Sized {
/// exit if `--help` or `--version` are passed and if any errors are found.
fn check<I>(args: I)
where
I: IntoIterator + 'static,
I: IntoIterator,
I::Item: Into<OsString>,
{
exit_if_err(Self::try_check(args), Self::EXIT_CODE)
@@ -98,7 +98,7 @@ pub trait Arguments: Sized {
/// exit if `--help` or `--version` are passed.
fn try_check<I>(args: I) -> Result<(), Error>
where
I: IntoIterator + 'static,
I: IntoIterator,
I::Item: Into<OsString>,
{
let mut iter = Self::parse(args);
@@ -124,7 +124,7 @@ pub struct ArgumentIter<T: Arguments> {
impl<T: Arguments> ArgumentIter<T> {
fn from_args<I>(args: I) -> Self
where
I: IntoIterator + 'static,
I: IntoIterator,
I::Item: Into<OsString>,
{
Self {
@@ -181,7 +181,7 @@ pub trait Options<Arg: Arguments>: Sized {
/// Parse an iterator of arguments into the options
fn parse<I>(self, args: I) -> Self
where
I: IntoIterator + 'static,
I: IntoIterator,
I::Item: Into<OsString>,
{
exit_if_err(self.try_parse(args), Arg::EXIT_CODE)
@@ -190,7 +190,7 @@ pub trait Options<Arg: Arguments>: Sized {
#[allow(unused_mut)]
fn try_parse<I>(mut self, args: I) -> Result<Self, Error>
where
I: IntoIterator + 'static,
I: IntoIterator,
I::Item: Into<OsString>,
{
// Hacky but it works: if the parse-is-complete flag is active the
@@ -225,7 +225,7 @@ pub trait Options<Arg: Arguments>: Sized {
#[cfg(feature = "parse-is-complete")]
fn print_complete<I, O: Options<Arg>, Arg: Arguments>(mut args: I)
where
I: Iterator + 'static,
I: Iterator,
I::Item: Into<OsString>,
{
let _exec_name = args.next();
+1 -1
View File
@@ -37,7 +37,7 @@ impl Options<Arg> for Settings {
}
}
fn parse(args: &'static [&'static str]) -> Settings {
fn parse(args: &[&str]) -> Settings {
let mut settings = Settings::default().parse(args);
if !settings.multiple {
assert_eq!(settings.names.len(), 2);
+2 -2
View File
@@ -10,7 +10,7 @@ use uutils_args::{Arguments, Options, Value};
// optional at compile time. As the GNU docs explain, it's very error-prone.
fn parse_deprecated<I>(iter: I) -> Option<Settings>
where
I: IntoIterator + Clone + 'static,
I: IntoIterator + Clone,
I::Item: Into<OsString>,
{
let mut iter = iter.into_iter();
@@ -210,7 +210,7 @@ impl Options<Arg> for Settings {
fn parse_head<I>(iter: I) -> Result<Settings, uutils_args::Error>
where
I: IntoIterator + Clone + 'static,
I: IntoIterator + Clone,
I::Item: Into<OsString>,
{
match parse_deprecated(iter.clone()) {
+2 -2
View File
@@ -10,7 +10,7 @@ use uutils_args::{Arguments, Options, Value};
// optional at compile time. As the GNU docs explain, it's very error-prone.
fn parse_deprecated<I>(iter: I) -> Option<Settings>
where
I: IntoIterator + Clone + 'static,
I: IntoIterator + Clone,
I::Item: Into<OsString>,
{
let mut iter = iter.into_iter();
@@ -275,7 +275,7 @@ impl Options<Arg> for Settings {
fn parse_tail<I>(iter: I) -> Result<Settings, uutils_args::Error>
where
I: IntoIterator + Clone + 'static,
I: IntoIterator + Clone,
I::Item: Into<OsString>,
{
match parse_deprecated(iter.clone()) {