Skip to content

Commit 958902c

Browse files
committed
chore: update rust discounts allocator function
1 parent ade6840 commit 958902c

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

Cargo.lock

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

discounts/rust/discounts-allocator/default/src/run.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use shopify_function::Result;
44
#[shopify_function_target(query_path = "src/run.graphql", schema_path = "schema.graphql")]
55
fn run(input: input::ResponseData) -> Result<output::FunctionRunResult> {
66
let no_discounts = output::FunctionRunResult {
7-
line_discounts: Some(vec![]),
8-
displayable_errors: Some(vec![]),
7+
line_discounts: Some(vec![]),
8+
displayable_errors: Some(vec![]),
99
};
1010

1111
Ok(no_discounts)
@@ -15,10 +15,11 @@ fn run(input: input::ResponseData) -> Result<output::FunctionRunResult> {
1515
mod tests {
1616
use super::*;
1717
use shopify_function::run_function_with_input;
18-
use run::output;
1918

2019
#[test]
2120
fn test_result_with_no_discounts() -> Result<()> {
21+
use run::output;
22+
2223
let result = run_function_with_input(
2324
run,
2425
r#"
@@ -30,12 +31,11 @@ mod tests {
3031
"#,
3132
)?;
3233
let expected = output::FunctionRunResult {
33-
line_discounts: Some(vec![]),
34-
displayable_errors: Some(vec![]),
34+
line_discounts: Some(vec![]),
35+
displayable_errors: Some(vec![]),
3536
};
3637

3738
assert_eq!(result, expected);
3839
Ok(())
3940
}
40-
4141
}

0 commit comments

Comments
 (0)