summaryrefslogtreecommitdiffstats
path: root/rust
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-05-15 23:06:05 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-05-15 23:06:05 -0700
commitb2d5968e0a7ac5576782f54980c930345f4c5298 (patch)
treec2a64fd29193153888b696bb7f811c49e6bd9a4d /rust
parent8517c76b92d5fa7041c330438e33f2b08924ac7b (diff)
downloadfatcat-b2d5968e0a7ac5576782f54980c930345f4c5298.tar.gz
fatcat-b2d5968e0a7ac5576782f54980c930345f4c5298.zip
fmt
Diffstat (limited to 'rust')
-rw-r--r--rust/TODO2
-rw-r--r--rust/src/api_server.rs18
2 files changed, 10 insertions, 10 deletions
diff --git a/rust/TODO b/rust/TODO
index e374dae7..86f17c22 100644
--- a/rust/TODO
+++ b/rust/TODO
@@ -9,7 +9,7 @@ x cleanup pooled database: https://github.com/diesel-rs/diesel/pull/1466
x clean up blasse error handling a bit
x add 404s to gets
x wow. fix a bunch of api schema names ("FindASingleContainerByExternalIdentifer")
-- refactor handlers to have a proper Result<_,_> error-chain type, so I can use '?'
+x refactor handlers to have a proper Result<_,_> error-chain type, so I can use '?'
- one-to-many relationship (eg, works)
- many-to-many relationship (eg, creators)
- creators, releases, works, files (?)
diff --git a/rust/src/api_server.rs b/rust/src/api_server.rs
index 200ecdb2..47139363 100644
--- a/rust/src/api_server.rs
+++ b/rust/src/api_server.rs
@@ -27,15 +27,15 @@ pub struct Server {
}
impl Server {
-
fn container_id_get_handler(&self, id: String) -> Result<Option<ContainerEntity>> {
let conn = self.db_pool.get().expect("db_pool error");
let id = uuid::Uuid::parse_str(&id)?;
- let res: ::std::result::Result<(ContainerIdentRow, ContainerRevRow), _> = container_ident::table
- .find(id)
- .inner_join(container_rev::table)
- .first(&conn);
+ let res: ::std::result::Result<(ContainerIdentRow, ContainerRevRow), _> =
+ container_ident::table
+ .find(id)
+ .inner_join(container_rev::table)
+ .first(&conn);
let (ident, rev) = match res {
Ok(r) => r,
@@ -101,7 +101,6 @@ impl Server {
}
impl Api for Server {
-
fn container_id_get(
&self,
id: String,
@@ -129,9 +128,10 @@ impl Api for Server {
) -> Box<Future<Item = ContainerLookupGetResponse, Error = ApiError> + Send> {
let conn = self.db_pool.get().expect("db_pool error");
- let res: ::std::result::Result<(ContainerIdentRow, ContainerRevRow), _> = container_ident::table
- .inner_join(container_rev::table)
- .first(&conn);
+ let res: ::std::result::Result<(ContainerIdentRow, ContainerRevRow), _> =
+ container_ident::table
+ .inner_join(container_rev::table)
+ .first(&conn);
// XXX: actually do a filter/lookup
let (ident, rev) = match res {