We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Crate
load_version()
1 parent edb9362 commit ffff496Copy full SHA for ffff496
src/controllers/version.rs
@@ -31,7 +31,16 @@ pub struct CrateVersionPath {
31
32
impl CrateVersionPath {
33
pub async fn load_version(&self, conn: &mut AsyncPgConnection) -> AppResult<Version> {
34
- Ok(self.load_version_and_crate(conn).await?.0)
+ use ext::*;
35
+
36
+ let (_, version) = self
37
+ .crate_and_version()
38
+ .select((crates::id, Option::<Version>::as_select()))
39
+ .first::<(i32, _)>(conn)
40
+ .await
41
+ .optional()?
42
+ .gather_from_path(self)?;
43
+ Ok(version)
44
}
45
46
pub async fn load_version_and_crate(
0 commit comments