projects
/
recipes.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Add asynchronous call to database.
[recipes.git]
/
backend
/
src
/
utils.rs
diff --git a/backend/src/utils.rs
b/backend/src/utils.rs
new file mode 100644
(file)
index 0000000..
d39a970
--- /dev/null
+++ b/
backend/src/utils.rs
@@ -0,0
+1,11
@@
+use log::error;
+
+pub fn unwrap_print_err<T, E>(r: Result<T, E>) -> T
+where
+ E: std::fmt::Debug
+{
+ if let Err(ref error) = r {
+ error!("{:?}", error);
+ }
+ r.unwrap()
+}
\ No newline at end of file