Remove unused functions

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2024-07-17 01:27:38 +10:00
parent 8d85b37834
commit 5a8692f1d6
No known key found for this signature in database
GPG key ID: 76D1E687CA3C4928
2 changed files with 1 additions and 13 deletions

View file

@ -66,12 +66,6 @@ impl CratesToml<'_> {
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) {
self.v1.retain(|(s, _bin)| {
s.split_once(' ')

View file

@ -1,6 +1,6 @@
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 miette::Diagnostic;
use semver::Version;
@ -42,12 +42,6 @@ pub enum Source<'a> {
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> {
fn from(source: &'a CrateSource) -> Self {
use SourceType::*;