From 0d8b865ba4889a5e21e3972e7853858cf3bfcbc2 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 28 Jul 2022 19:48:45 +1000 Subject: [PATCH] Update `binstall_v1::default_path` and fix typo in it The postfix should be `.json`, not `.toml`. Signed-off-by: Jiahao XU --- src/metafiles/binstall_v1.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/metafiles/binstall_v1.rs b/src/metafiles/binstall_v1.rs index cebdb722..2cfc58f8 100644 --- a/src/metafiles/binstall_v1.rs +++ b/src/metafiles/binstall_v1.rs @@ -1,7 +1,7 @@ use std::{ borrow, cmp, collections::{btree_set, BTreeSet}, - hash, + fs, hash, io::{self, Seek, Write}, iter::{IntoIterator, Iterator}, path::{Path, PathBuf}, @@ -132,7 +132,11 @@ pub fn write_to( } pub fn default_path() -> Result { - Ok(cargo_home()?.join(".binstall-crates.toml")) + let dir = cargo_home()?.join("binstall"); + + fs::create_dir_all(&dir)?; + + Ok(dir.join("crates-v1.json")) } #[derive(Debug)]