summaryrefslogtreecommitdiffstats
path: root/rust/src/endpoints.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-01-09 00:12:16 -0800
committerBryan Newbold <bnewbold@robocracy.org>2019-01-09 00:12:16 -0800
commit5dca65fa0992bedb826aa7a762dc69e1beaed2de (patch)
tree2f736147f38543632ec2c2135fc48d382f727ec0 /rust/src/endpoints.rs
parent9979d34df0cdef3be2fb40b6da4c4eaddeb5ba79 (diff)
downloadfatcat-5dca65fa0992bedb826aa7a762dc69e1beaed2de.tar.gz
fatcat-5dca65fa0992bedb826aa7a762dc69e1beaed2de.zip
some clippy nits
Diffstat (limited to 'rust/src/endpoints.rs')
-rw-r--r--rust/src/endpoints.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/rust/src/endpoints.rs b/rust/src/endpoints.rs
index 91db1027..c1033bc7 100644
--- a/rust/src/endpoints.rs
+++ b/rust/src/endpoints.rs
@@ -4,6 +4,9 @@
//! response types (mapping to HTTP statuses. Some contain actual endpoint implementations, but
//! most implementation lives in the server module.
+// using closures as a Result/? hack
+#![allow(clippy::redundant_closure_call)]
+
use crate::auth::*;
use crate::database_models::EntityEditRow;
use crate::editing::*;
@@ -1075,10 +1078,10 @@ impl Api for Server {
let mut entity = entity.clone();
match entity.editor_id.clone() {
Some(editor_id) => {
- if !auth_context.has_role(FatcatRole::Admin) {
- if editor_id != auth_context.editor_id.to_string() {
- bail!("not authorized to create editgroups in others' names");
- }
+ if editor_id != auth_context.editor_id.to_string()
+ && !auth_context.has_role(FatcatRole::Admin)
+ {
+ bail!("not authorized to create editgroups in others' names");
}
}
None => {