summaryrefslogtreecommitdiff
path: root/Return a static literal.md
diff options
context:
space:
mode:
authorJasper Ras <jras@hostnet.nl>2025-08-08 22:44:15 +0200
committerJasper Ras <jras@hostnet.nl>2025-08-08 22:44:15 +0200
commit22675cd8dc75d8b8d4b0f818f5b093efbc364802 (patch)
tree90156d37dccf13f012d535e7d92273259e3d5c17 /Return a static literal.md
parent295b343aecf330e830d79f06e0efc511e7d76da1 (diff)
vault backup: 2025-08-08 22:44:15HEADmain
Diffstat (limited to 'Return a static literal.md')
-rw-r--r--Return a static literal.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/Return a static literal.md b/Return a static literal.md
new file mode 100644
index 0000000..bbf6a47
--- /dev/null
+++ b/Return a static literal.md
@@ -0,0 +1,8 @@
+If the data doesn't change it's possible to return a literal, which is static:
+```rust
+fn return() -> &'static str {
+ "yest"
+}
+```
+
+not sure what benefit this offers though, we could just use a const? \ No newline at end of file