Commit cdddac4
committed
aider: USER: Please don't leave the files in the project root. Put them analogously to the Go txamples.
ASSISTANT: To transpile the plain Golang testdata into a Rust project, we need to:
1. Create a new Rust project.
2. Create a new Rust file for the `plain` function.
3. Translate the `plain` function from Go to Rust.
Here are the *SEARCH/REPLACE* blocks:
testdata/rust/plain/Cargo.toml
```toml
<<<<<<< SEARCH
=======
[package]
name = "plain"
version = "0.1.0"
edition = "2021"
[dependencies]
>>>>>>> REPLACE
```
testdata/rust/plain/src/lib.rs
```rust
<<<<<<< SEARCH
=======
pub fn plain() {
// This does not do anything but it gives us a line to cover.
}
>>>>>>> REPLACE
```
# Diffs:
diff --git a/testdata/rust/plain/Cargo.toml b/testdata/rust/plain/Cargo.toml
new file mode 100644
index 00000000..6f4d8472
--- /dev/null
+++ b/testdata/rust/plain/Cargo.toml
@@ -0,0 +1,6 @@
+[package]
+name = "plain"
+version = "0.1.0"
+edition = "2021"
+
+[dependencies]
diff --git a/testdata/rust/plain/src/lib.rs b/testdata/rust/plain/src/lib.rs
new file mode 100644
index 00000000..3ef5a2e
--- /dev/null
+++ b/testdata/rust/plain/src/lib.rs
@@ -0,0 +1,3 @@
+pub fn plain() {
+ // This does not do anything but it gives us a line to cover.
+}1 parent 8103a0d commit cdddac4
3 files changed
+20
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
0 commit comments