Skip to content

Commit bc17c43

Browse files
LawnGnomeTurbo87
andauthored
Update src/controllers/krate/publish.rs
Co-authored-by: Tobias Bieniek <[email protected]>
1 parent ab718e5 commit bc17c43

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/controllers/krate/publish.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,9 @@ pub async fn publish(app: AppState, req: BytesRequest) -> AppResult<Json<GoodCra
222222
return Err(cargo_err("expected at most 5 categories per crate"));
223223
}
224224

225-
let max_features = match &existing_crate {
226-
Some(c) => c.max_features.map(|mf| mf as usize),
227-
None => None,
228-
}.unwrap_or(app.config.max_features);
225+
let max_features = existing_crate.as_ref()
226+
.and_then(|c| c.max_features.map(|mf| mf as usize))
227+
.unwrap_or(app.config.max_features);
229228

230229
let features = tarball_info.manifest.features.unwrap_or_default();
231230
let num_features = features.len();

0 commit comments

Comments
 (0)