Lint
This commit is contained in:
parent
7a5365d7f4
commit
5af95c91af
|
@ -20,30 +20,24 @@ impl Base32Config {
|
||||||
|
|
||||||
pub fn base32_encoding(config: Base32Config) -> Result<Encoding, ShellError> {
|
pub fn base32_encoding(config: Base32Config) -> Result<Encoding, ShellError> {
|
||||||
match (config.nopad, config.dnscurve, config.dnssec) {
|
match (config.nopad, config.dnscurve, config.dnssec) {
|
||||||
(Some(nopad), Some(dnscurve), _) => {
|
(Some(nopad), Some(dnscurve), _) => Err(ShellError::IncompatibleParameters {
|
||||||
return Err(ShellError::IncompatibleParameters {
|
|
||||||
left_message: "Inapplicable to DNSCURVE".to_string(),
|
left_message: "Inapplicable to DNSCURVE".to_string(),
|
||||||
left_span: nopad,
|
left_span: nopad,
|
||||||
right_message: "Must be used standalone".to_string(),
|
right_message: "Must be used standalone".to_string(),
|
||||||
right_span: dnscurve,
|
right_span: dnscurve,
|
||||||
});
|
}),
|
||||||
}
|
(_, Some(dnscurve), Some(dnssec)) => Err(ShellError::IncompatibleParameters {
|
||||||
(_, Some(dnscurve), Some(dnssec)) => {
|
|
||||||
return Err(ShellError::IncompatibleParameters {
|
|
||||||
left_message: "Incompatible with DNSCURVE".to_string(),
|
left_message: "Incompatible with DNSCURVE".to_string(),
|
||||||
left_span: dnssec,
|
left_span: dnssec,
|
||||||
right_message: "Must be used standalone".to_string(),
|
right_message: "Must be used standalone".to_string(),
|
||||||
right_span: dnscurve,
|
right_span: dnscurve,
|
||||||
});
|
}),
|
||||||
}
|
(Some(nopad), _, Some(dnssec)) => Err(ShellError::IncompatibleParameters {
|
||||||
(Some(nopad), _, Some(dnssec)) => {
|
|
||||||
return Err(ShellError::IncompatibleParameters {
|
|
||||||
left_message: "Inapplicable to DNSCURVE".to_string(),
|
left_message: "Inapplicable to DNSCURVE".to_string(),
|
||||||
left_span: nopad,
|
left_span: nopad,
|
||||||
right_message: "DNSCURVE must be used standalone".to_string(),
|
right_message: "DNSCURVE must be used standalone".to_string(),
|
||||||
right_span: dnssec,
|
right_span: dnssec,
|
||||||
});
|
}),
|
||||||
}
|
|
||||||
|
|
||||||
(None, None, None) => Ok(data_encoding::BASE32),
|
(None, None, None) => Ok(data_encoding::BASE32),
|
||||||
(Some(_), None, None) => Ok(data_encoding::BASE32_NOPAD),
|
(Some(_), None, None) => Ok(data_encoding::BASE32_NOPAD),
|
||||||
|
|
|
@ -99,7 +99,8 @@ impl Command for EncodeBase64 {
|
||||||
(Type::Binary, Type::String),
|
(Type::Binary, Type::String),
|
||||||
])
|
])
|
||||||
.allow_variants_without_examples(true)
|
.allow_variants_without_examples(true)
|
||||||
.required("encoding", SyntaxShape::String, "encoding to use")
|
.switch("url", "Use the URL-safe Base64 version.", None)
|
||||||
|
.switch("nopad", "Don't pad the output.", None)
|
||||||
.category(Category::Formats)
|
.category(Category::Formats)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user