fix(rust): replace now() TODO stub with real SystemTime::now() call

The Rust generator emitted '0u64 /* TODO: use std::time::SystemTime */'
for now() calls. Replace with the real expression:
std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).unwrap().as_secs()

Resolves the TODO in compiler/src/generators/rust.ts:544.
This commit is contained in:
tef-engine 2026-07-19 01:26:26 -07:00
parent 857fa6ceb4
commit 8f78ceac28

View file

@ -541,7 +541,7 @@ function rewriteRustExpr(
// Step 1: Replace function calls
let rust = expr
.replace(/\bnow\(\)/g, '0u64 /* TODO: use std::time::SystemTime */')
.replace(/\bnow\(\)/g, 'std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).unwrap().as_secs()')
.replace(/\blen\(([^)]+)\)/g, '$1.len()')
.replace(/\blength\(([^)]+)\)/g, '$1.len()')
.replace(/\bjoin\(([^,]+),\s*([^)]+)\)/g, '$1.join($2)')