diff --git a/src/main.rs b/src/main.rs index 035d2d4..d94016e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -361,12 +361,10 @@ impl std::str::FromStr for UploadAction { Ok(Self::Skip) }else if s=="new\n"{ Ok(Self::New) + }else if let Ok(asset_id)=s[..s.len()-1].parse::(){ + Ok(Self::Upload(asset_id)) }else{ - if let Ok(asset_id)=s[..s.len()-1].parse::(){ - Ok(Self::Upload(asset_id)) - }else{ - Err(ParseUploadActionErr) - } + Err(ParseUploadActionErr) } } }