Trim opts

This commit is contained in:
Ayaz Hafiz 2023-04-02 09:14:54 -05:00
parent 2f43aad8d0
commit 25f58a74cc
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58

View file

@ -136,7 +136,7 @@ impl TestCase {
let found_infer_opts = RE_OPT_INFER.captures_iter(data); let found_infer_opts = RE_OPT_INFER.captures_iter(data);
for infer_opt in found_infer_opts { for infer_opt in found_infer_opts {
let opt = infer_opt.name("opt").unwrap().as_str(); let opt = infer_opt.name("opt").unwrap().as_str();
match opt { match opt.trim() {
"allow_errors" => infer_opts.allow_errors = true, "allow_errors" => infer_opts.allow_errors = true,
"print_only_under_alias" => infer_opts.print_only_under_alias = true, "print_only_under_alias" => infer_opts.print_only_under_alias = true,
other => return Err(format!("unknown infer option: {other}").into()), other => return Err(format!("unknown infer option: {other}").into()),
@ -152,7 +152,7 @@ impl TestCase {
let found_infer_opts = RE_OPT_PRINT.captures_iter(data); let found_infer_opts = RE_OPT_PRINT.captures_iter(data);
for infer_opt in found_infer_opts { for infer_opt in found_infer_opts {
let opt = infer_opt.name("opt").unwrap().as_str(); let opt = infer_opt.name("opt").unwrap().as_str();
match opt { match opt.trim() {
"can_decls" => print_opts.can_decls = true, "can_decls" => print_opts.can_decls = true,
other => return Err(format!("unknown print option: {other}").into()), other => return Err(format!("unknown print option: {other}").into()),
} }