mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-06-14 14:46:37 +00:00
Update create_if_not_exist usage in mod binstall_crates_v1
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
This commit is contained in:
parent
90e824d57c
commit
239116db68
1 changed files with 3 additions and 2 deletions
|
@ -43,7 +43,8 @@ where
|
|||
Iter: IntoIterator<Item = T>,
|
||||
Data: From<T>,
|
||||
{
|
||||
let mut file = FileLock::new_exclusive(create_if_not_exist(path.as_ref())?)?;
|
||||
let path = path.as_ref();
|
||||
let mut file = create_if_not_exist(path)?;
|
||||
// Move the cursor to EOF
|
||||
file.seek(io::SeekFrom::End(0))?;
|
||||
|
||||
|
@ -166,7 +167,7 @@ impl Records {
|
|||
|
||||
pub fn load_from_path(path: impl AsRef<Path>) -> Result<Self, Error> {
|
||||
let mut this = Self {
|
||||
file: FileLock::new_exclusive(create_if_not_exist(path.as_ref())?)?,
|
||||
file: create_if_not_exist(path.as_ref())?,
|
||||
data: BTreeSet::default(),
|
||||
};
|
||||
this.load_impl()?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue