mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-06-16 07:36:38 +00:00
Remove unused functions
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
8d85b37834
commit
5a8692f1d6
2 changed files with 1 additions and 13 deletions
|
@ -66,12 +66,6 @@ impl CratesToml<'_> {
|
||||||
Self::load_from_reader(file)
|
Self::load_from_reader(file)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Only use it when you know that the crate is not in the manifest.
|
|
||||||
/// Otherwise, you need to call [`CratesToml::remove`] first.
|
|
||||||
fn insert(&mut self, cvs: &CrateVersionSource, bins: Vec<CompactString>) {
|
|
||||||
self.v1.push((cvs.to_string(), Cow::owned(bins)));
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn remove(&mut self, name: &str) {
|
pub fn remove(&mut self, name: &str) {
|
||||||
self.v1.retain(|(s, _bin)| {
|
self.v1.retain(|(s, _bin)| {
|
||||||
s.split_once(' ')
|
s.split_once(' ')
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use std::{borrow::Cow, fmt, str::FromStr};
|
use std::{borrow::Cow, fmt, str::FromStr};
|
||||||
|
|
||||||
use binstalk_types::{crate_info::cratesio_url, maybe_owned::MaybeOwned};
|
use binstalk_types::maybe_owned::MaybeOwned;
|
||||||
use compact_str::CompactString;
|
use compact_str::CompactString;
|
||||||
use miette::Diagnostic;
|
use miette::Diagnostic;
|
||||||
use semver::Version;
|
use semver::Version;
|
||||||
|
@ -42,12 +42,6 @@ pub enum Source<'a> {
|
||||||
Registry(MaybeOwned<'a, Url>),
|
Registry(MaybeOwned<'a, Url>),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Source<'static> {
|
|
||||||
pub fn cratesio_registry() -> Self {
|
|
||||||
Self::Registry(MaybeOwned::Borrowed(cratesio_url()))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'a> From<&'a CrateSource> for Source<'a> {
|
impl<'a> From<&'a CrateSource> for Source<'a> {
|
||||||
fn from(source: &'a CrateSource) -> Self {
|
fn from(source: &'a CrateSource) -> Self {
|
||||||
use SourceType::*;
|
use SourceType::*;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue