We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Crate
load_version()
1 parent d9c3709 commit 1028929Copy full SHA for 1028929
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