Rename binstall_v1::Entry to Item

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2022-07-26 22:47:57 +10:00
parent f0b6b7b1af
commit c6c5dcd79f
No known key found for this signature in database
GPG key ID: 591C0B03040416D6

View file

@ -16,7 +16,7 @@ use crate::binstall::MetaData;
use crate::FileLock;
#[derive(Debug, Serialize, Deserialize)]
pub struct Entry {
pub struct Item {
pub name: CompactString,
pub version_req: CompactString,
pub current_version: Version,
@ -24,7 +24,7 @@ pub struct Entry {
pub target: CompactString,
pub bins: Vec<CompactString>,
}
impl Entry {
impl Item {
pub fn new(metadata: MetaData) -> Self {
let MetaData {
bins,
@ -87,7 +87,7 @@ pub enum Error {
pub fn append_to_path<Iter>(path: impl AsRef<Path>, iter: Iter) -> Result<(), Error>
where
Iter: IntoIterator<Item = Entry>,
Iter: IntoIterator<Item = Item>,
{
let file = FileLock::new_exclusive(
fs::OpenOptions::new()