about summary refs log tree commit diff
path: root/src/docs/question_mark.txt
diff options
context:
space:
mode:
Diffstat (limited to 'src/docs/question_mark.txt')
-rw-r--r--src/docs/question_mark.txt18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/docs/question_mark.txt b/src/docs/question_mark.txt
new file mode 100644
index 00000000000..4dc987be881
--- /dev/null
+++ b/src/docs/question_mark.txt
@@ -0,0 +1,18 @@
+### What it does
+Checks for expressions that could be replaced by the question mark operator.
+
+### Why is this bad?
+Question mark usage is more idiomatic.
+
+### Example
+```
+if option.is_none() {
+    return None;
+}
+```
+
+Could be written:
+
+```
+option?;
+```
\ No newline at end of file