Update compiler (#725)

* update compiler to recent nightly

* cargo fmt

* fix clippy

but ructe code is still complaining

* update circleci and rocket_csrf

* fix last clippy problems

* cargo fmt

* fix build issue

was caused be improper handling of recursive template (comment) by old ructe, which is fixed on newer version
This commit is contained in:
fdb-hiroshima
2020-01-19 12:52:32 +01:00
committed by Ana Gelez
parent 72464fb428
commit 3663bffe5c
30 changed files with 201 additions and 155 deletions
+3 -11
View File
@@ -307,21 +307,13 @@ Then try to restart Plume
rocket::http::Method::Post,
)
.add_exceptions(vec![
(
"/inbox".to_owned(),
"/inbox".to_owned(),
rocket::http::Method::Post,
),
("/inbox".to_owned(), "/inbox".to_owned(), None),
(
"/@/<name>/inbox".to_owned(),
"/@/<name>/inbox".to_owned(),
rocket::http::Method::Post,
),
(
"/api/<path..>".to_owned(),
"/api/<path..>".to_owned(),
rocket::http::Method::Post,
None,
),
("/api/<path..>".to_owned(), "/api/<path..>".to_owned(), None),
])
.finalize()
.expect("main: csrf fairing creation error"),
+1 -1
View File
@@ -137,7 +137,7 @@ pub fn create(form: LenientForm<NewBlogForm>, rockets: PlumeRocket) -> RespondOr
.expect("blog::create: author error");
Flash::success(
Redirect::to(uri!(details: name = slug.clone(), page = _)),
Redirect::to(uri!(details: name = slug, page = _)),
&i18n!(intl, "Your blog was successfully created!"),
)
.into()
+1 -2
View File
@@ -379,8 +379,7 @@ fn ban(
.unwrap();
let target = User::one_by_instance(&*conn)?;
let delete_act = u.delete_activity(&*conn)?;
let u_clone = u.clone();
worker.execute(move || broadcast(&u_clone, delete_act, target));
worker.execute(move || broadcast(&u, delete_act, target));
}
Ok(())
+7 -9
View File
@@ -298,7 +298,7 @@ pub fn update(
post.license = form.license.clone();
post.cover_id = form.cover;
post.update(&*conn, &rockets.searcher)
.expect("post::update: update error");;
.expect("post::update: update error");
if post.published {
post.update_mentions(
@@ -308,7 +308,7 @@ pub fn update(
.filter_map(|m| Mention::build_activity(&rockets, &m).ok())
.collect(),
)
.expect("post::update: mentions error");;
.expect("post::update: mentions error");
}
let tags = form
@@ -367,8 +367,8 @@ pub fn update(
&*form,
form.draft,
Some(post),
errors.clone(),
medias.clone(),
errors,
medias,
cl.0
))
.into()
@@ -406,7 +406,7 @@ pub fn create(
rockets: PlumeRocket,
) -> Result<RespondOrRedirect, ErrorPage> {
let conn = &*rockets.conn;
let blog = Blog::find_by_fqn(&rockets, &blog_name).expect("post::create: blog error");;
let blog = Blog::find_by_fqn(&rockets, &blog_name).expect("post::create: blog error");
let slug = form.title.to_string().to_kebab_case();
let user = rockets.user.clone().unwrap();
@@ -553,7 +553,7 @@ pub fn create(
&*form,
form.draft,
None,
errors.clone(),
errors,
medias,
cl.0
))
@@ -579,9 +579,7 @@ pub fn delete(
.any(|a| a.id == user.id)
{
return Ok(Flash::error(
Redirect::to(
uri!(details: blog = blog_name.clone(), slug = slug.clone(), responding_to = _),
),
Redirect::to(uri!(details: blog = blog_name, slug = slug, responding_to = _)),
i18n!(intl.catalog, "You are not allowed to delete this article."),
));
}
+1 -1
View File
@@ -355,7 +355,7 @@ pub fn edit(name: String, user: User, rockets: PlumeRocket) -> Result<Ructe, Err
ValidationErrors::default()
)))
} else {
Err(Error::Unauthorized)?
Err(Error::Unauthorized.into())
}
}