Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
radicle-cli: replace emoji unwrap with expect
Adrian Duke committed 3 months ago
commit a9a703da0472c5669d0e5affef0a4660ffac444a
parent f6225d6c41255a836e916474dde722542ec5539d
1 file changed +1 -4
modified crates/radicle-cli/src/commands/patch/args.rs
@@ -393,9 +393,6 @@ pub(super) enum CommentAction {
    },
}

-
// `emoji.unwrap()` is safe because an --emoji is required by --react and
-
// --react requires --emoji in Clap. See CommentArts::react and CommentArgs::emoji.
-
#[allow(clippy::fallible_impl_from)]
impl From<CommentArgs> for CommentAction {
    fn from(
        CommentArgs {
@@ -418,7 +415,7 @@ impl From<CommentArgs> for CommentAction {
            (None, Some(react), None) => CommentAction::React {
                revision,
                comment: react,
-
                emoji: emoji.unwrap(),
+
                emoji: emoji.expect("emoji must be Some when react is Some"),
                undo,
            },
            (None, None, Some(redact)) => CommentAction::Redact {