From 22675cd8dc75d8b8d4b0f818f5b093efbc364802 Mon Sep 17 00:00:00 2001 From: Jasper Ras Date: Fri, 8 Aug 2025 22:44:15 +0200 Subject: vault backup: 2025-08-08 22:44:15 --- Return a static literal.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Return a static literal.md (limited to 'Return a static literal.md') 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 -- cgit v1.2.3