This is my mergesort algorithm that I implemented using Vectors and T(generic object names in Rust). Generics are implemented using the <> brackets. The polymorphism is showcased by passing in the comparator struct, which will compare the two vectors indices to find which is smaller.
This is part of my implementation of the LinkedList structure. It contains a couple of components. First, it uses polymorphism to pass in the comp function as a datatype, which allows it to compare the node's data and the target as references. It also implements generics (with the <T>), and uses a while let signature, which is unique to rust.