Skip to content

Commit 2933dda

Browse files
committed
applied cargo fmt
1 parent 07e2932 commit 2933dda

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/interpreter/expression_eval.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ pub fn eval_function_call(
564564
"tuple_get" => {
565565
if args.len() != 2 {
566566
return Err(
567-
"[Runtime Error] tuple_get expects exactly 2 arguments".into(),
567+
"[Runtime Error] tuple_get expects exactly 2 arguments".into()
568568
);
569569
}
570570

@@ -588,9 +588,7 @@ pub fn eval_function_call(
588588
if let Statement::Return(expr) = stmt {
589589
Ok(ExpressionResult::Value(*expr))
590590
} else {
591-
Err(
592-
"[Runtime Error] tuple_get builtin did not return a value".into(),
593-
)
591+
Err("[Runtime Error] tuple_get builtin did not return a value".into())
594592
}
595593
}
596594

src/pretty_print/pretty_type.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ impl ToDoc for Type {
3030

3131
Type::TTuple(types) => {
3232
let inner_docs = types.iter().map(|t| t.to_doc()).collect();
33-
concat(text("Tuple["), concat(join(text(", "), inner_docs), text("]")))
33+
concat(
34+
text("Tuple["),
35+
concat(join(text(", "), inner_docs), text("]")),
36+
)
3437
}
3538

3639
Type::TMaybe(t) => concat(text("Maybe["), concat(t.to_doc(), text("]"))),

src/stdlib/standard_library.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,9 @@ pub fn tuple_get_builtin(env: &mut Environment<Expression>) -> Statement {
6363
Expression::CString("tuple_get: index must be >= 0".to_string())
6464
} else {
6565
let idx = i as usize;
66-
items
67-
.get(idx)
68-
.cloned()
69-
.unwrap_or(Expression::CString("tuple_get: index out of bounds".to_string()))
66+
items.get(idx).cloned().unwrap_or(Expression::CString(
67+
"tuple_get: index out of bounds".to_string(),
68+
))
7069
}
7170
}
7271
(Some(other), Some(Expression::CInt(_))) => Expression::CString(format!(

0 commit comments

Comments
 (0)