mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-20 12:38:43 +00:00
Rm unnecessary Arc
inside DesiredTargetsInner
Since `DesiredTargets` is now stored in `binstall::Options`, which itself is wrapped in an `Arc`, `DesiredTargetsInner::Initialized` no longer needs an `Arc` for O(1) `clone`. Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
6a95bb07e0
commit
eda7b9445a
1 changed files with 2 additions and 2 deletions
|
@ -11,7 +11,7 @@ pub const TARGET: &str = env!("TARGET");
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
enum DesiredTargetsInner {
|
enum DesiredTargetsInner {
|
||||||
AutoDetect(Arc<OnceCell<Vec<String>>>),
|
AutoDetect(Arc<OnceCell<Vec<String>>>),
|
||||||
Initialized(Arc<Vec<String>>),
|
Initialized(Vec<String>),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
@ -19,7 +19,7 @@ pub struct DesiredTargets(DesiredTargetsInner);
|
||||||
|
|
||||||
impl DesiredTargets {
|
impl DesiredTargets {
|
||||||
fn initialized(targets: Vec<String>) -> Self {
|
fn initialized(targets: Vec<String>) -> Self {
|
||||||
Self(DesiredTargetsInner::Initialized(Arc::new(targets)))
|
Self(DesiredTargetsInner::Initialized(targets))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn auto_detect() -> Self {
|
fn auto_detect() -> Self {
|
||||||
|
|
Loading…
Add table
Reference in a new issue