How to see the code for crate published in


I run into different crates specifying different versions of same library and then causing build failures. Of-course carefully planning Cargo.toml etc will avoid it, but I’m just trying to find out if these two things are possible:

<1> For any code published to the crates, can i see the source code from within the crate (github repository link is what we write in Cargo.toml so can be invalid as well) - so is there any inherent way to check the source code from what is there in itself ?

<2> cargo build first downloads the source and then compiles it if there is anything in Cargo.toml as [dependencies] from I am on linux. So is there anyway i can browse this downloaded source code ?



[andrew@Serval] curl -L '' | tar -zxf -
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 82065  100 82065    0     0   107k      0 --:--:-- --:--:-- --:--:--  202k
[andrew@Serval] cd regex-0.1.38/
[andrew@Serval regex-0.1.38] $EDITOR src/

I don’t know what the exact directory layout is, but tree $HOME/.cargo | less should be enough to make you dangerous. :slight_smile: