Good job with you first crate! 🎉
Here are some things you might consider.
You can remove serde and serde_json crates, if you use values directly in the code, like const TORCH_SOURCES: &[TorchSource] = ..., but you cannot make Strings in the const context so you will ether need to change the TorchSource to use &'static str or use the LazyCell<Vec<TourchSource>> (i think that would be easier)
static TORCH_SOURCES: LazyCell<Vec<TorchSource>> = LazyCell::new(|| {
vec![
TorchSource {
cuda: "12.8".into(),
source: "cu128".into(),
url: "https://download.pytorch.org/whl/cu128".into(),
},
TorchSource {
cuda: "12.1".into(),
source: "cu121".into(),
url: "https://download.pytorch.org/whl/cu121".into(),
},
TorchSource {
cuda: "11.8".into(),
source: "cu118".into(),
url: "https://download.pytorch.org/whl/cu118".into(),
},
TorchSource {
cuda: "11.7".into(),
source: "cu117".into(),
url: "https://download.pytorch.org/whl/cu117".into(),
},
TorchSource {
cuda: "11.6".into(),
source: "cu116".into(),
url: "https://download.pytorch.org/whl/cu116".into(),
},
TorchSource {
cuda: "11.3".into(),
source: "cu113".into(),
url: "https://download.pytorch.org/whl/cu113".into(),
},
TorchSource {
cuda: "10.2".into(),
source: "cu102".into(),
url: "https://download.pytorch.org/whl/cu102".into(),
},
TorchSource {
cuda: "cpu".into(),
source: "cpu".into(),
url: "https://download.pytorch.org/whl/cpu".into(),
},
]
});