mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-21 13:08:42 +00:00
Impl binstall_v1::Source::cratesio_registry
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
cc13aa911f
commit
1a8fda1f5e
1 changed files with 10 additions and 1 deletions
|
@ -12,7 +12,7 @@ use serde::{Deserialize, Serialize};
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
use crate::{cargo_home, FileLock};
|
use crate::{cargo_home, cratesio_url, FileLock};
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
pub struct MetaData {
|
pub struct MetaData {
|
||||||
|
@ -61,6 +61,15 @@ pub struct Source {
|
||||||
url: Url,
|
url: Url,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Source {
|
||||||
|
pub fn cratesio_registry() -> Source {
|
||||||
|
Self {
|
||||||
|
source_type: SourceType::Registry,
|
||||||
|
url: cratesio_url().clone(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl From<super::Source> for Source {
|
impl From<super::Source> for Source {
|
||||||
fn from(src: super::Source) -> Self {
|
fn from(src: super::Source) -> Self {
|
||||||
use super::Source::*;
|
use super::Source::*;
|
||||||
|
|
Loading…
Add table
Reference in a new issue