Added rust-toolchain.toml file; removed nightly-only rustfmt.toml
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/deploy Pipeline was successful

This commit is contained in:
Jef Roosens 2022-04-28 10:56:30 +02:00
parent 0b9b5bb8e7
commit aa3051a6ef
Signed by: Jef Roosens
GPG key ID: B580B976584B5F30
7 changed files with 12 additions and 88 deletions

View file

@ -14,8 +14,7 @@ use tokio_util::io::StreamReader;
use crate::{DEFAULT_STATIC_SITE, STATIC_DIR_NAME};
#[derive(Deserialize)]
pub struct StaticDirParams
{
pub struct StaticDirParams {
dir: Option<String>,
}
@ -23,8 +22,7 @@ pub async fn post_deploy(
Extension(data_dir): Extension<String>,
Query(params): Query<StaticDirParams>,
res: BodyStream,
) -> impl IntoResponse
{
) -> impl IntoResponse {
// This converts a stream into something that implements AsyncRead, which we can then use to
// asynchronously write the file to disk
let mut read =
@ -56,8 +54,7 @@ pub async fn post_deploy(
res
}
fn process_archive(archive_path: &Path, static_dir: &Path) -> Result<(), ()>
{
fn process_archive(archive_path: &Path, static_dir: &Path) -> Result<(), ()> {
let file = std::fs::File::open(archive_path).map_err(|_| ())?;
let tar = GzDecoder::new(file);
let mut archive = Archive::new(tar);

View file

@ -2,7 +2,6 @@ use axum::{routing::post, Router};
mod deploy;
pub fn router() -> Router
{
pub fn router() -> Router {
Router::new().route("/deploy", post(deploy::post_deploy))
}