Add more helper functions

This commit is contained in:
JT
2021-10-20 18:58:25 +13:00
parent 11070ffbbe
commit b322a12f58
12 changed files with 98 additions and 121 deletions

View File

@ -34,7 +34,10 @@ impl Command for Git {
Ok(val) => {
let result = val.stdout;
Ok(Value::string(&String::from_utf8_lossy(&result), call.head))
Ok(Value::String {
val: String::from_utf8_lossy(&result).to_string(),
span: call.head,
})
}
Err(_err) => {
// FIXME: Move this to an external signature and add better error handling

View File

@ -49,7 +49,10 @@ impl Command for GitCheckout {
Ok(val) => {
let result = val.stdout;
Ok(Value::string(&String::from_utf8_lossy(&result), call.head))
Ok(Value::String {
val: String::from_utf8_lossy(&result).to_string(),
span: call.head,
})
}
Err(_err) => {
// FIXME: Move this to an external signature and add better error handling