Skip to content

Commit cdddac4

Browse files
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

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

testdata/rust/plain/Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[package]
2+
name = "plain"
3+
version = "0.1.0"
4+
edition = "2024"
5+
6+
[dependencies]
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"tasks": ["write-tests"],
3+
"scores": {
4+
"write-tests": {
5+
"lib.rs": {
6+
"coverage": 1,
7+
"files-executed-maximum-reachable": 1
8+
}
9+
}
10+
}
11+
}

testdata/rust/plain/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pub fn plain() {
2+
// This does not do anything but it gives us a line to cover.
3+
}

0 commit comments

Comments
 (0)