From 00a52e3d631df0a7610f4f17a9bd6d60205239fd Mon Sep 17 00:00:00 2001 From: Jasper Ras Date: Mon, 4 Aug 2025 08:46:49 +0200 Subject: vault backup: 2025-08-04 08:46:49 --- How to return from a function.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 How to return from a function.md (limited to 'How to return from a function.md') diff --git a/How to return from a function.md b/How to return from a function.md new file mode 100644 index 0000000..0fde1fc --- /dev/null +++ b/How to return from a function.md @@ -0,0 +1,6 @@ +[[Rust]] +[[Adding a semicolon to the end of a line turns it into a statement]] + +In Rust we can return from a function with simply an expression at the end of the scope. + +The `return` keyword is mostly used for returning early. \ No newline at end of file -- cgit v1.2.3