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 --- Statement vs expression.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Statement vs expression.md (limited to 'Statement vs expression.md') diff --git a/Statement vs expression.md b/Statement vs expression.md new file mode 100644 index 0000000..e899857 --- /dev/null +++ b/Statement vs expression.md @@ -0,0 +1,9 @@ +[[Rust]] +[[A scope block is an expression]] +[[How to return from a function]] +[[Adding a semicolon to the end of a line turns it into a statement]] +[[It is not possible to do a chain assignment]] +[[An empty tuple is called a unit]] + +An expression returns something, ie `1 + 2` returns `3`. +A statement on the other hand does not return anything: as assignment is a statement. It equals to the unit! \ No newline at end of file -- cgit v1.2.3