refactor(commands): remove Reset as a parameter type

This commit is contained in:
dusk 2025-01-15 00:21:11 +09:00
parent 6c54551a9e
commit 2a063442ea
No known key found for this signature in database
6 changed files with 6 additions and 17 deletions

View file

@ -51,14 +51,4 @@ public static class ContextParametersExt
param => (param as Parameter.Toggle)?.value
);
}
// this can never really be false (either it's present and is true or it's not present)
// but we keep it nullable for consistency with the other methods
public static async Task<bool?> ParamResolveReset(this Context ctx, string param_name)
{
return await ctx.Parameters.ResolveParameter<bool?>(
ctx, param_name,
param => param is Parameter.Reset
);
}
}

View file

@ -13,7 +13,6 @@ public abstract record Parameter()
public record PrivacyLevel(string level): Parameter;
public record Toggle(bool value): Parameter;
public record Opaque(string value): Parameter;
public record Reset(): Parameter;
}
public class Parameters
@ -80,8 +79,6 @@ public class Parameters
return new Parameter.Toggle(toggle.toggle);
case uniffi.commands.Parameter.OpaqueString opaque:
return new Parameter.Opaque(opaque.raw);
case uniffi.commands.Parameter.Reset _:
return new Parameter.Reset();
}
return null;
}