What's in crate files?

I've run a quick analysis on directory listings of all crate files published on crates.io (to show a pie chart with crate contents of non-pure-Rust crates). Here's top 100 of most common filename extensions:

  1. .html × 178415
  2. .rs × 147826
  3. .c × 53092
  4. .h × 34328
  5. .f × 19817
  6. .txt × 14395
  7. .gitignore × 14330
  8. .orig × 11790 — somebody forgot to use Cargo's include/exclude :slight_smile:
  9. .cpp × 11374
  10. .md × 9356
  11. .yml × 8542
  12. .bin × 8337
  13. .cc × 7578
  14. .py × 7509
  15. .js × 6605
  16. .s × 5384
  17. .json × 4817
  18. .rb × 4495
  19. .sh × 4304
  20. .png × 3344
  21. .a × 2909
  22. .toml × 2878
  23. .3 × 2734
  24. .hpp × 2688
  25. .in × 2121
  26. .xml × 2079
  27. .java × 1848
  28. .asm × 1775
  29. .wren × 1771
  30. .frag × 1733
  31. .reference × 1707
  32. .out × 1504
  33. .td × 1287
  34. .rst × 1187
  35. .vim × 1148
  36. .cs × 1101
  37. .sublime-snippet × 916
  38. .match × 898
  39. .vcxproj × 863
  40. .mk × 825
  41. .yaml × 808
  42. .ps1 × 794
  43. .m4 × 790
  44. .css × 775
  45. .cmake × 756
  46. .woff × 721
  47. .vert × 720
  48. .am × 710
  49. .o × 686
  50. .pem × 674
  51. .pb × 660
  52. .pl × 643
  53. .svg × 606
  54. .gyp × 598
  55. .filters × 577
  56. .exp × 564
  57. .sql × 529
  58. .build × 515
  59. .ttf × 468
  60. .comp × 468
  61. .1 × 466
  62. .lua × 465
  63. .pod × 464
  64. .pas × 448
  65. .bmp × 430
  66. .markdown × 429
  67. .cfg × 427
  68. .proto × 396
  69. .m × 366
  70. .gitmodules × 341
  71. .dyon × 330
  72. .wast × 323
  73. .bat × 322
  74. .mm × 313
  75. .hh × 311
  76. .jpg × 310
  77. .props × 308
  78. .editorconfig × 308
  79. .tcc × 296
  80. .crt × 296
  81. .ttl × 292
  82. .d × 290
  83. .adoc × 283
  84. .vcproj × 274
  85. .sln × 271
  86. .data × 270
  87. .stderr × 255
  88. .atdf × 255
  89. .inc × 254
  90. .go × 246
  91. .orth × 244
  92. .gif × 237
  93. .lp × 233
  94. .gitattributes × 225
  95. .conf × 223
  96. .ml × 215
  97. .glsl × 210
  98. .jsonnet × 204
  99. .lo × 200
  100. .csv × 196
1 Like

It's interesting that crates.io contains more html files than rust

2 Likes

Thant's probably Cargo.toml.orig, which are created by Cargo:

During publishing, Cargo rewrites your Cargo.toml (to replace workspace path deps with real deps at least, and for something else as well I think), but it preserves original toml with .orig extension just in case.

1 Like

Ah, indeed!

Well that's a lot, but I suppose it entails the generated documentation for the crates?