Added rust-toolchain.toml file; removed nightly-only rustfmt.toml
This commit is contained in:
parent
0b9b5bb8e7
commit
aa3051a6ef
7 changed files with 12 additions and 88 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue