Skip to content

Glossary: Data Structures and Algorithms in Rust

clone()

Also written: clone

A method that makes an independent copy of a value. BFS clones each neighbor because the queue and the visited set each need their own copy.

Where the book teaches it

Related terms

Ownership