chore
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@ use log::info;
|
|||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use tokio::fs;
|
use tokio::fs;
|
||||||
|
|
||||||
use crate::{File, base64_decode};
|
use crate::File;
|
||||||
|
|
||||||
pub async fn files(files: &[File], root: &str, dry_run: bool) -> Result<()> {
|
pub async fn files(files: &[File], root: &str, dry_run: bool) -> Result<()> {
|
||||||
for f in files {
|
for f in files {
|
||||||
|
|||||||
+3
-3
@@ -151,10 +151,10 @@ impl<'t> Host<'t> {
|
|||||||
self.dls.get_json(format!("hosts/{}", self.name)).await
|
self.dls.get_json(format!("hosts/{}", self.name)).await
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn asset(
|
pub async fn asset<N: Display>(
|
||||||
&self,
|
&self,
|
||||||
asset_name: &str,
|
asset_name: N,
|
||||||
) -> Result<impl Stream<Item = reqwest::Result<Bytes>>> {
|
) -> Result<impl Stream<Item = reqwest::Result<Bytes>> + use<N>> {
|
||||||
let req = self.dls.get(format!("hosts/{}/{asset_name}", self.name))?;
|
let req = self.dls.get(format!("hosts/{}/{asset_name}", self.name))?;
|
||||||
let resp = do_req(req, &self.dls.token).await?;
|
let resp = do_req(req, &self.dls.token).await?;
|
||||||
Ok(resp.bytes_stream())
|
Ok(resp.bytes_stream())
|
||||||
|
|||||||
+1
-1
@@ -171,7 +171,7 @@ impl FileKind {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl FilePart {
|
impl FilePart {
|
||||||
pub fn content(&self) -> Result<Cow<[u8]>, base64::DecodeError> {
|
pub fn content(&self) -> Result<Cow<'_, [u8]>, base64::DecodeError> {
|
||||||
use FilePart::*;
|
use FilePart::*;
|
||||||
Ok(match self {
|
Ok(match self {
|
||||||
Content(content) => Cow::Borrowed(content.as_bytes()),
|
Content(content) => Cow::Borrowed(content.as_bytes()),
|
||||||
|
|||||||
Reference in New Issue
Block a user