mikecargal

mikecargal

Hands-on Rust: why a second clone?

Title: Hands-On Rust (Chapter 10: Iterating Away the Chaos)

in the iteration function, why is it necessary to return a clone of new_tiles (which was already cloned from map.tiles?)

Marked As Solved

herbert

herbert

Author of Hands-on Rust

I have a build (I wish I had room to include it in the book) that plays itself over and over. After a few hours, no errors with the clone omitted - so it’ll be trimmed for the next beta. Thanks! :slight_smile:

Also Liked

mikecargal

mikecargal

Yeah, I skipped it, and now that I have things wired up it seems to work fine. Guess I’ll let you know if I stumble across some issue.

herbert

herbert

Author of Hands-on Rust

That’s actually a very good question. It appears to work fine without it (it replaces the copy with a move; both compile down to memcpy so it winds up not making a lot of difference in terms of performance). My notes indicate that I had problems with an earlier Rust compiler there, so I’m going to test the heck out of it before committing the change. Thanks!

Popular Pragmatic Bookshelf topics Top

herminiotorres
Hi @Margaret , On page VII the book tells us the example and snippets will be all using Elixir version 1.11 But on page 3 almost the en...
New
brian-m-ops
#book-python-testing-with-pytest-second-edition Hi. Thanks for writing the book. I am just learning so this might just of been an issue ...
New
AndyDavis3416
@noelrappin Running the webpack dev server, I receive the following warning: ERROR in tsconfig.json TS18003: No inputs were found in c...
New
jskubick
I’m running Android Studio “Arctic Fox” 2020.3.1 Patch 2, and I’m embarrassed to admit that I only made it to page 8 before running into ...
New
jskubick
I’m under the impression that when the reader gets to page 136 (“View Data with the Database Inspector”), the code SHOULD be able to buil...
New
New
adamwoolhether
Is there any place where we can discuss the solutions to some of the exercises? I can figure most of them out, but am having trouble with...
New
andreheijstek
After running /bin/setup, the first error was: The foreman' command exists in these Ruby versions: That was easy to fix: gem install fore...
New
New
SlowburnAZ
Getting an error when installing the dependencies at the start of this chapter: could not compile dependency :exla, "mix compile" failed...
New

Other popular topics Top

AstonJ
A thread that every forum needs! Simply post a link to a track on YouTube (or SoundCloud or Vimeo amongst others!) on a separate line an...
New
Exadra37
I am thinking in building or buy a desktop computer for programing, both professionally and on my free time, and my choice of OS is Linux...
New
foxtrottwist
Here’s our thread for the Keyboardio Atreus. It is a mechanical keyboard based on and a slight update of the original Atreus (Keyboardio ...
New
AstonJ
This looks like a stunning keycap set :orange_heart: A LEGENDARY KEYBOARD LIVES ON When you bought an Apple Macintosh computer in the e...
New
Margaret
Hello everyone! This thread is to tell you about what authors from The Pragmatic Bookshelf are writing on Medium.
1132 25321 748
New
AstonJ
Saw this on TikTok of all places! :lol: Anyone heard of them before? Lite:
New
husaindevelop
Inside our android webview app, we are trying to paste the copied content from another app eg (notes) using navigator.clipboard.readtext ...
New
PragmaticBookshelf
Author Spotlight: VM Brasseur @vmbrasseur We have a treat for you today! We turn the spotlight onto Open Source as we sit down with V...
New
First poster: bot
zig/http.zig at 7cf2cbb33ef34c1d211135f56d30fe23b6cacd42 · ziglang/zig. General-purpose programming language and toolchain for maintaini...
New
AstonJ
This is cool! DEEPSEEK-V3 ON M4 MAC: BLAZING FAST INFERENCE ON APPLE SILICON We just witnessed something incredible: the largest open-s...
New

Latest in Hands-on Rust

Hands-on Rust Portal