Start working on save

This commit is contained in:
Jonathan Turner 2019-08-30 03:39:16 +12:00
parent f730296e45
commit b6db233c73

View File

@ -89,7 +89,7 @@ fn save(
} }
let content = if !save_raw { let content = if !save_raw {
to_string_for(full_path.extension(), &input) to_string_for(full_path.extension(), &input).await
} else { } else {
string_from(&input) string_from(&input)
}; };
@ -114,7 +114,7 @@ fn save(
let input: Vec<Tagged<Value>> = input.values.collect().await; let input: Vec<Tagged<Value>> = input.values.collect().await;
let content = if !save_raw { let content = if !save_raw {
to_string_for(full_path.extension(), &input) to_string_for(full_path.extension(), &input).await
} else { } else {
string_from(&input) string_from(&input)
}; };
@ -153,7 +153,7 @@ fn string_from(input: &Vec<Tagged<Value>>) -> Result<String, ShellError> {
Ok(save_data) Ok(save_data)
} }
fn to_string_for( async fn to_string_for(
ext: Option<&std::ffi::OsStr>, ext: Option<&std::ffi::OsStr>,
input: &Vec<Tagged<Value>>, input: &Vec<Tagged<Value>>,
) -> Result<String, ShellError> { ) -> Result<String, ShellError> {