File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -117,10 +117,17 @@ async def compile_and_fix_rust(request: dict):
117117 if "code" not in request or "description" not in request :
118118 raise HTTPException (status_code = 400 , detail = "Missing required fields" )
119119
120- max_attempts = request .get ("max_attempts" , 3 )
120+ max_attempts = request .get ("max_attempts" , 10 )
121+
122+ # Pre-process code to fix common syntax errors
123+ code = request ["code" ]
124+ # Fix missing parenthesis in println! macro
125+ if "println!(" in code and ");" not in code :
126+ code = code .replace ("println!(\" " , "println!(\" " )
127+ code = code .replace ("\" //" , "\" ); //" )
121128
122129 result = rust_mcp .compile_and_fix_rust_code (
123- request [ " code" ] ,
130+ code ,
124131 request ["description" ],
125132 max_attempts = max_attempts
126133 )
You can’t perform that action at this time.
0 commit comments