From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 522A8168 for ; Mon, 19 Jul 2021 18:47:59 +0000 (UTC) Received: from oasis.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 759AE610D0; Mon, 19 Jul 2021 18:47:57 +0000 (UTC) Date: Mon, 19 Jul 2021 14:47:55 -0400 From: Steven Rostedt To: Miguel Ojeda Cc: Geert Uytterhoeven , Arnd Bergmann , Wedson Almeida Filho , Linus Walleij , Greg KH , Bartosz Golaszewski , Kees Cook , Jan Kara , James Bottomley , Julia Lawall , Laurent Pinchart , Roland Dreier , ksummit@lists.linux.dev, Viresh Kumar Subject: Re: [TECH TOPIC] Rust for Linux Message-ID: <20210719144756.307e5d4d@oasis.local.home> In-Reply-To: References: <20210707203827.GI18396@quack2.suse.cz> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: ksummit@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 19 Jul 2021 20:24:51 +0200 Miguel Ojeda wrote: > On Mon, Jul 19, 2021 at 4:43 PM Geert Uytterhoeven wrote: > > > > Turns out "a..b" in Rust does mean "range from a to b-1". > > That's gonna be hard to (un)learn... > > It may help to think about it as the usual `for` loop in C, typically > written with `<` and the "size" (instead of `<=` and the "size - 1"), > i.e.: > > for i in 0..N > for (i = 0; i < N; ++i) > Or think of it as the python range() function, but not as a git log, where git log sha1..sha2 is a list of commits from sha1 + 1 through to sha2 inclusive :-p -- Steve