I was thinking about skipping the dependencies building step in cargo. I have a simple project that uses 3 crates as dependencies mentioned in the Cargo.toml. I build the project once using cargo build --release. Now I had another project that used the same dependencies mentioned in its Cargo.toml file. I wanted to skip building deps for this project so I just copied the contents of my previous project's target/release/ directory into the new project by creating a target directory in the root of the new project.
I ran cargo build --release for the new project but it built all the dependencies again. I thought that it would simply skip that step and just build my source code. Whereas if I build my old project again it doesn't take much time and doesn't rebuild the deps again since they are there in the target folder.
So I wanted to know what does cargo look for in the target directory to determine whether to rebuild the deps or not?