aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mingling/src/gen_program.rs10
-rw-r--r--mingling/src/setups/picker/basic.rs21
2 files changed, 18 insertions, 13 deletions
diff --git a/mingling/src/gen_program.rs b/mingling/src/gen_program.rs
index ef32074..90860b6 100644
--- a/mingling/src/gen_program.rs
+++ b/mingling/src/gen_program.rs
@@ -184,7 +184,7 @@ unsafe impl Grouped<ThisProgram> for CompletionSuggest {
}
impl ProgramCollect for ThisProgram {
- type Enum = ThisProgram;
+ type Enum = Self;
type EntryFallback = EntryFallback;
@@ -260,13 +260,15 @@ impl ProgramCollect for ThisProgram {
}
impl ThisProgram {
- /// Create a program through this ProgramCollect.
- pub fn new() -> Program<ThisProgram> {
+ /// Create a program through this `ProgramCollect`.
+ #[must_use]
+ pub fn new() -> Program<Self> {
todo!()
}
/// Get the global singleton of the current program.
- pub fn this() -> &'static Program<ThisProgram> {
+ #[must_use]
+ pub fn this() -> &'static Program<Self> {
todo!()
}
}
diff --git a/mingling/src/setups/picker/basic.rs b/mingling/src/setups/picker/basic.rs
index 7f70eab..24276d2 100644
--- a/mingling/src/setups/picker/basic.rs
+++ b/mingling/src/setups/picker/basic.rs
@@ -36,12 +36,13 @@ pub struct HelpFlagSetup<'a> {
impl<'a> HelpFlagSetup<'a> {
/// Creates a new `HelpFlagSetup` with the given flag aliases.
- pub fn new(flag: &'a PickerArg<Flag>) -> Self {
+ #[must_use]
+ pub const fn new(flag: &'a PickerArg<Flag>) -> Self {
Self { flag }
}
}
-impl<'a, C> ProgramSetup<C> for HelpFlagSetup<'a>
+impl<C> ProgramSetup<C> for HelpFlagSetup<'_>
where
C: ProgramCollect<Enum = C>,
{
@@ -53,7 +54,7 @@ where
}
}
-impl<'a> Default for HelpFlagSetup<'a> {
+impl Default for HelpFlagSetup<'_> {
fn default() -> Self {
Self { flag: &HELP_FLAG }
}
@@ -68,12 +69,13 @@ pub struct QuietFlagSetup<'a> {
impl<'a> QuietFlagSetup<'a> {
/// Creates a new `QuietFlagSetup` with the given flag aliases.
- pub fn new(flag: &'a PickerArg<Flag>) -> Self {
+ #[must_use]
+ pub const fn new(flag: &'a PickerArg<Flag>) -> Self {
Self { flag }
}
}
-impl<'a, C> ProgramSetup<C> for QuietFlagSetup<'a>
+impl<C> ProgramSetup<C> for QuietFlagSetup<'_>
where
C: ProgramCollect<Enum = C>,
{
@@ -86,7 +88,7 @@ where
}
}
-impl<'a> Default for QuietFlagSetup<'a> {
+impl Default for QuietFlagSetup<'_> {
fn default() -> Self {
Self { flag: &QUIET_FLAG }
}
@@ -101,12 +103,13 @@ pub struct ConfirmFlagSetup<'a> {
impl<'a> ConfirmFlagSetup<'a> {
/// Creates a new `ConfirmFlagSetup` with the given flag aliases.
- pub fn new(flag: &'a PickerArg<Flag>) -> Self {
+ #[must_use]
+ pub const fn new(flag: &'a PickerArg<Flag>) -> Self {
Self { flag }
}
}
-impl<'a, C> ProgramSetup<C> for ConfirmFlagSetup<'a>
+impl<C> ProgramSetup<C> for ConfirmFlagSetup<'_>
where
C: ProgramCollect<Enum = C>,
{
@@ -120,7 +123,7 @@ where
}
}
-impl<'a> Default for ConfirmFlagSetup<'a> {
+impl Default for ConfirmFlagSetup<'_> {
fn default() -> Self {
Self {
flag: &CONFIRM_FLAG,