From 86010bec092d074b161800da06149cfb79fb9f4b Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 8 Jul 2024 10:12:10 -0400 Subject: fix(workspace): better cli file argument handling (#24447) Closes https://github.com/denoland/deno/issues/24422 --- cli/util/collections.rs | 38 -------------------------------------- cli/util/mod.rs | 1 - 2 files changed, 39 deletions(-) delete mode 100644 cli/util/collections.rs (limited to 'cli/util') diff --git a/cli/util/collections.rs b/cli/util/collections.rs deleted file mode 100644 index 21f73024b..000000000 --- a/cli/util/collections.rs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. - -use std::marker::PhantomData; - -pub struct CheckedSet { - _kind: PhantomData, - checked: std::collections::HashSet, -} - -impl Default for CheckedSet { - fn default() -> Self { - Self { - _kind: Default::default(), - checked: Default::default(), - } - } -} - -impl CheckedSet { - pub fn with_capacity(capacity: usize) -> Self { - Self { - _kind: PhantomData, - checked: std::collections::HashSet::with_capacity(capacity), - } - } - - pub fn insert(&mut self, value: &T) -> bool { - self.checked.insert(self.get_hash(value)) - } - - fn get_hash(&self, value: &T) -> u64 { - use std::collections::hash_map::DefaultHasher; - use std::hash::Hasher; - let mut hasher = DefaultHasher::new(); - value.hash(&mut hasher); - hasher.finish() - } -} diff --git a/cli/util/mod.rs b/cli/util/mod.rs index 2b6583fbc..b7eef95d3 100644 --- a/cli/util/mod.rs +++ b/cli/util/mod.rs @@ -2,7 +2,6 @@ // Note: Only add code in this folder that has no application specific logic pub mod checksum; -pub mod collections; pub mod console; pub mod diff; pub mod display; -- cgit v1.2.3