Skip to content

Commit 3109c7c

Browse files
Merge pull request #2093 from kristof-mattei/copilot-instructions
copilot instructions
2 parents 7f20036 + a494929 commit 3109c7c

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.github/copilot-instructions.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Rules:
2+
3+
- Be strict
4+
- Show places where downstream effects occur, e.g. when `iter()` causes `clone()`, post the lines of code where the `clone()` occurs as well
5+
- Don't assume
6+
- Think about the language, e.g. if it's Rust we care about memory.
7+
- Don't suggest `fn foo(s: &str) -> String { todo!() }` is better than `fn foo(s: impl Into<Cow<'_, str>>) -> Cow<'_, str> { todo!() }` because
8+
'in most places we pass something by ref'. Most is not all. This is NOT a good recommendation.
9+
If there is a single place where we pass it by value our code is better, as it avoids allocations, even at the cost of reading complexity.
10+
- `fn foo<'i, I: Into<Cow<'i, str>>>(f: I) -> Cow<'i, str> { todo!() }` is not complex, it is the correct way to write it in Rust

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"debug.internalConsoleOptions": "neverOpen",
3-
"lldb.launch.terminal": "integrated",
43
"lldb.launch.expressions": "simple",
4+
"lldb.launch.terminal": "integrated",
55
"prettier.configPath": "./prettier.config.mjs",
66
"rust-analyzer.runnables.extraEnv": {
77
"RUST_LOG": "DEBUG,rust_seed=TRACE"

0 commit comments

Comments
 (0)