Skip to content

Commit

Permalink
Reduce the number of places we need to specify version::ALL_COLUMNS
Browse files Browse the repository at this point in the history
  • Loading branch information
carols10cents committed Feb 8, 2019
1 parent 2e9f46e commit dccc89f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/bin/delete-version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

use cargo_registry::{
db,
models::{Crate, Version},
models::{Crate, CrateVersions, Version},
schema::versions,
};
use std::{
Expand Down Expand Up @@ -45,9 +45,9 @@ fn delete(conn: &PgConnection) {
};

let krate = Crate::by_name(&name).first::<Crate>(conn).unwrap();
let v = Version::belonging_to(&krate)
let v = krate
.all_versions()
.filter(versions::num.eq(&version))
.select(cargo_registry::models::version::ALL_COLUMNS)
.first::<Version>(conn)
.unwrap();
print!(
Expand Down

0 comments on commit dccc89f

Please sign in to comment.