fix: enable space string in yaml value (#4286)

* fix: enable space string in yaml value

* fix: typo
This commit is contained in:
shuiyisong
2024-07-05 11:39:26 +08:00
committed by GitHub
parent b5c6c72b02
commit 69bb7ded6a
2 changed files with 3 additions and 3 deletions

View File

@@ -182,7 +182,7 @@ fn parse_processor(doc: &yaml_rust::Yaml) -> Result<Arc<dyn Processor>, String>
pub(crate) fn yaml_string(v: &yaml_rust::Yaml, field: &str) -> Result<String, String> {
v.as_str()
.map(|s| s.trim().to_string())
.map(|s| s.to_string())
.ok_or(format!("'{field}' must be a string"))
}

View File

@@ -39,7 +39,7 @@ use crate::python::utils::format_py_error;
#[test]
fn convert_scalar_to_py_obj_and_back() {
rustpython_vm::Interpreter::with_init(Default::default(), |vm| {
// this can be in `.enter()` closure, but for clearity, put it in the `with_init()`
// this can be in `.enter()` closure, but for clarity, put it in the `with_init()`
let _ = PyVector::make_class(&vm.ctx);
})
.enter(|vm| {
@@ -422,7 +422,7 @@ fn test_vm() {
rustpython_vm::Interpreter::with_init(Default::default(), |vm| {
vm.add_native_module("udf_builtins", Box::new(greptime_builtin::make_module));
// this can be in `.enter()` closure, but for clearity, put it in the `with_init()`
// this can be in `.enter()` closure, but for clarity, put it in the `with_init()`
let _ = PyVector::make_class(&vm.ctx);
})
.enter(|vm| {