Include imports in Edge Rust snippets (#2437)

* Allow rust code snippets to start with a comment line

* Include imports in Edge Rust snippets

* Add import per code block; use fqn when class name is ambiguous
This commit is contained in:
Abdon Pijpelink
2026-06-29 15:39:06 +02:00
committed by GitHub
parent 60c789224e
commit 708c40573d
44 changed files with 307 additions and 185 deletions
+1 -1
View File
@@ -67,7 +67,7 @@ class LanguageRust(Language):
RE_CODE = re.compile(
r"""
(?P<uses> (?:use\s[^;]+;\n|\n)* )
(?P<uses> (?:use\s[^;]+;\n|//[^\n]*\n|\n)* )
pub\s+async\s+fn\s+main\(\)\s*->\s*anyhow::Result<\(\)>\s*\{\n
(?P<body> .*? )
\s*Ok\(\(\)\)\n