Fix user management example

This commit is contained in:
Emi Tatsuo 2020-11-19 16:24:38 -05:00
parent fb205cd397
commit f0517ef0b7
Signed by: Emi
GPG Key ID: 68FAB2E2E6DFC98B
1 changed files with 3 additions and 2 deletions

View File

@ -1,5 +1,6 @@
use anyhow::*;
use futures::{future::BoxFuture, FutureExt};
use futures_core::future::BoxFuture;
use futures_util::FutureExt;
use log::LevelFilter;
use northstar::{
GEMINI_MIME,
@ -51,7 +52,7 @@ fn handle_request(request: Request) -> BoxFuture<'static, Result<Response>> {
if request.path_segments()[0].eq("push") { // User connecting to /push
if let Some(push) = request.input() {
user.as_mut().push_str(push);
user.save();
user.save()?;
} else {
return Ok(Response::input_lossy("Enter a string to push"));
}