File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -149,19 +149,18 @@ pub async fn update(
149149}
150150
151151fn validate_yank_update ( update_data : & VersionUpdate , version : & Version ) -> AppResult < ( ) > {
152- match ( update_data. yanked , & update_data . yank_message ) {
153- ( Some ( false ) , Some ( _ ) ) => {
152+ if update_data. yank_message . is_some ( ) {
153+ if matches ! ( update_data . yanked , Some ( false ) ) {
154154 return Err ( bad_request ( "Cannot set yank message when unyanking" ) ) ;
155155 }
156- ( None , Some ( _) ) => {
157- if !version. yanked {
158- return Err ( bad_request (
159- "Cannot update yank message for a version that is not yanked" ,
160- ) ) ;
161- }
156+
157+ if update_data. yanked . is_none ( ) && !version. yanked {
158+ return Err ( bad_request (
159+ "Cannot update yank message for a version that is not yanked" ,
160+ ) ) ;
162161 }
163- _ => { }
164162 }
163+
165164 Ok ( ( ) )
166165}
167166
You can’t perform that action at this time.
0 commit comments