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:
parent
857fa6ceb4
commit
8f78ceac28
1 changed files with 1 additions and 1 deletions
|
|
@ -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)')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue