Skip to content

Commit a9379d9

Browse files
committed
Minor code improvements
1 parent d4412e2 commit a9379d9

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

Diff for: src/c/translate/expr/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ pub fn translate_expr(ctx: &mut TranslateCtx, expr: &Expr) -> Result<ast::Expr,
131131
}))
132132
.at(expr.source),
133133
ExprKind::Call(target, c_args) => {
134-
eprintln!("warning: c function call expression are not isolated yet to only call functions defined within then same file");
135134
eprintln!("warning: c function call expression cannot call expression yet");
136135

137136
let c::ast::ExprKind::Identifier(target) = &target.as_ref().kind else {

Diff for: src/resolve/helper_expr.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use crate::{
99
asg::{Asg, HelperExprDecl},
1010
ast::AstWorkspace,
1111
};
12-
use std::borrow::Cow;
1312

1413
pub fn resolve_helper_expressions(
1514
ctx: &mut ResolveCtx,
@@ -20,12 +19,10 @@ pub fn resolve_helper_expressions(
2019
let module_folder_id = ast_workspace.get_owning_module_or_self(*physical_file_id);
2120
let settings = &ast_workspace.settings[file.settings.unwrap_or_default().0];
2221

23-
// NOTE: This module should already have a function haystack
24-
let func_haystack = Cow::Borrowed(
25-
ctx.func_haystacks
26-
.get(&module_folder_id)
27-
.expect("function haystack to exist for file"),
28-
);
22+
let func_haystack = ctx
23+
.func_haystacks
24+
.get(&module_folder_id)
25+
.expect("function haystack to exist for module");
2926

3027
for helper_expr in file.helper_exprs.iter() {
3128
let value = {

0 commit comments

Comments
 (0)