mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-21 13:08:42 +00:00
Rename binstall_v1::Item
to MetaData
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
951a0f8b9f
commit
cbd64b039d
1 changed files with 5 additions and 6 deletions
|
@ -12,11 +12,10 @@ use serde::{Deserialize, Serialize};
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
use crate::binstall::MetaData;
|
|
||||||
use crate::{cargo_home, FileLock};
|
use crate::{cargo_home, FileLock};
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
pub struct Item {
|
pub struct MetaData {
|
||||||
pub name: CompactString,
|
pub name: CompactString,
|
||||||
pub version_req: CompactString,
|
pub version_req: CompactString,
|
||||||
pub current_version: Version,
|
pub current_version: Version,
|
||||||
|
@ -24,9 +23,9 @@ pub struct Item {
|
||||||
pub target: CompactString,
|
pub target: CompactString,
|
||||||
pub bins: Vec<CompactString>,
|
pub bins: Vec<CompactString>,
|
||||||
}
|
}
|
||||||
impl Item {
|
impl MetaData {
|
||||||
pub fn new(metadata: MetaData) -> Self {
|
pub fn new(metadata: crate::binstall::MetaData) -> Self {
|
||||||
let MetaData {
|
let crate::binstall::MetaData {
|
||||||
bins,
|
bins,
|
||||||
cvs:
|
cvs:
|
||||||
super::CrateVersionSource {
|
super::CrateVersionSource {
|
||||||
|
@ -87,7 +86,7 @@ pub enum Error {
|
||||||
|
|
||||||
pub fn append_to_path<Iter>(path: impl AsRef<Path>, iter: Iter) -> Result<(), Error>
|
pub fn append_to_path<Iter>(path: impl AsRef<Path>, iter: Iter) -> Result<(), Error>
|
||||||
where
|
where
|
||||||
Iter: IntoIterator<Item = Item>,
|
Iter: IntoIterator<Item = MetaData>,
|
||||||
{
|
{
|
||||||
let file = FileLock::new_exclusive(
|
let file = FileLock::new_exclusive(
|
||||||
fs::OpenOptions::new()
|
fs::OpenOptions::new()
|
||||||
|
|
Loading…
Add table
Reference in a new issue