Skip to content

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vector From Scratch

A dynamic vector implemented from scratch in Rust.

This project was made to learn how unsafe Rust works and how dynamic data structures manage memory under the hood.

The vector uses raw pointers and manual heap allocation to implement things like:

  • push and pop
  • insert and remove
  • automatic capacity growth
  • indexing
  • iteration
  • manual memory cleanup

The goal is not to build a better Vec<T> than Rust's standard library, but to understand what happens behind the scenes when building a dynamic array.

Structure

src/
├── main.rs
└── vector.rs
  • vector.rs — implementation of the vector
  • main.rs — small example using it

Run

cargo run

Run the tests with:

cargo test

This is an educational project and is not intended for production use.

About

a Vec<T> implementation from scratch in Rust.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages