diff --git a/hashmap/extends.mbt b/hashmap/extends.mbt index a1f9a5401..e412fde09 100644 --- a/hashmap/extends.mbt +++ b/hashmap/extends.mbt @@ -39,11 +39,6 @@ pub extend HashMap with Default::{default} #doc(hidden) pub extend HashMap with Eq::{not_equal} -///| -#deprecated("Use `@debug.Debug` instead of `Show` for collections", skip_current_package=true) -#doc(hidden) -pub extend HashMap with Show::{output, to_string} - ///| #deprecated("Use `@json.to_json` instead", skip_current_package=true) #doc(hidden) diff --git a/hashmap/hashmap_coverage_test.mbt b/hashmap/hashmap_coverage_test.mbt index 532211163..98b2f8a64 100644 --- a/hashmap/hashmap_coverage_test.mbt +++ b/hashmap/hashmap_coverage_test.mbt @@ -130,25 +130,3 @@ test "get_from_bytes and get_from_string miss after probing" { @debug.assert_eq(str_map.get_from_string("missing\{i}"), None) } } - -///| -/// Render a hashmap through its (deprecated) `Show` instance. -#warnings("-deprecated") -fn show_map(m : @hashmap.HashMap[Int, Int]) -> String { - m.to_string() -} - -///| -test "Show renders a hashmap as a from_array expression" { - let m : @hashmap.HashMap[Int, Int] = HashMap([]) - m.set(1, 10) - m.set(2, 20) - let shown = show_map(m) - assert_true(shown.has_prefix("HashMap::from_array([")) - assert_true(shown.has_suffix("])")) - // two entries are separated by a comma - assert_true(shown.contains(", ")) - // an empty map still renders the wrapper - let e : @hashmap.HashMap[Int, Int] = HashMap([]) - inspect(show_map(e), content="HashMap::from_array([])") -} diff --git a/hashmap/pkg.generated.mbti b/hashmap/pkg.generated.mbti index fb2b0c141..c1b77ef82 100644 --- a/hashmap/pkg.generated.mbti +++ b/hashmap/pkg.generated.mbti @@ -61,8 +61,6 @@ pub fn[K : Hash + Eq, V] HashMap::update_or_default(Self[K, V], K, V, (V) -> V) pub fn[K, V] HashMap::values(Self[K, V]) -> Iter[V] pub impl[K, V] Default for HashMap[K, V] pub impl[K : Hash + Eq, V : Eq] Eq for HashMap[K, V] -#deprecated -pub impl[K : Show, V : Show] Show for HashMap[K, V] pub impl[K : Show, V : ToJson] ToJson for HashMap[K, V] pub impl[K : @debug.Debug, V : @debug.Debug] @debug.Debug for HashMap[K, V] pub impl[V : @json.FromJson] @json.FromJson for HashMap[String, V] diff --git a/hashmap/utils.mbt b/hashmap/utils.mbt index 3ecd385e1..1ff349ac8 100644 --- a/hashmap/utils.mbt +++ b/hashmap/utils.mbt @@ -323,34 +323,6 @@ pub fn[K, V] HashMap::eachi( } } -///| -/// Provides string representation for hash maps. -/// -/// Notice that the order of key-value pairs in the output string is not guaranteed -/// -/// Parameters: -/// -/// * `self` : The hash map to be converted to string. -/// * `logger` : The buffer to write the string representation to. -#deprecated("Use @debug.Debug instead of Show for debugging purposes. See https://github.com/moonbitlang/core/blob/main/debug/README.mbt.md") -pub impl[K : Show, V : Show] Show for HashMap[K, V] - -///| -pub impl[K : Show, V : Show] Show for HashMap[K, V] with fn output(self, logger) { - logger.write_string("HashMap::from_array([") - self.eachi((i, k, v) => { - if i > 0 { - logger.write_string(", ") - } - logger.write_string("(") - logger.write_object(k) - logger.write_string(", ") - logger.write_object(v) - logger.write_string(")") - }) - logger.write_string("])") -} - ///| /// Returns an iterator over all keys in the hash map. /// diff --git a/set/extends.mbt b/set/extends.mbt index 45d2f2358..bb4c1cba6 100644 --- a/set/extends.mbt +++ b/set/extends.mbt @@ -46,11 +46,6 @@ pub extend Set with Default::{default} #doc(hidden) pub extend Set with Eq::{not_equal} -///| -#deprecated("Use `@debug.Debug` instead of `Show` for collections", skip_current_package=true) -#doc(hidden) -pub extend Set with Show::{output, to_string} - ///| #deprecated("Use `@json.to_json` instead", skip_current_package=true) #doc(hidden) diff --git a/set/linked_hash_set.mbt b/set/linked_hash_set.mbt index 234152cc8..920c31d14 100644 --- a/set/linked_hash_set.mbt +++ b/set/linked_hash_set.mbt @@ -462,27 +462,6 @@ fn[K] Set::rehash_place_entry(self : Set[K], outer : Entry[K]) -> Unit { // Utils -///| -#deprecated("Use @debug.Debug instead of Show for debugging purposes. See https://github.com/moonbitlang/core/blob/main/debug/README.mbt.md") -pub impl[K : Show] Show for Set[K] - -///| -pub impl[K : Show] Show for Set[K] with fn output(self, logger) { - logger.write_string("{") - for i = 0, curr = self.head { - match (i, curr) { - (_, None) => break logger.write_string("}") - (i, Some({ key, next, .. })) => { - if i > 0 { - logger.write_string(", ") - } - logger.write_object(key) - continue i + 1, next - } - } - } -} - ///| /// Get the number of keys in the set. #alias(size, deprecated) diff --git a/set/pkg.generated.mbti b/set/pkg.generated.mbti index dfe934bcc..ccaa0b03a 100644 --- a/set/pkg.generated.mbti +++ b/set/pkg.generated.mbti @@ -58,8 +58,6 @@ pub impl[K : Hash + Eq] BitOr for Set[K] pub impl[K : Hash + Eq] BitXOr for Set[K] pub impl[K] Default for Set[K] pub impl[K : Hash + Eq] Eq for Set[K] -#deprecated -pub impl[K : Show] Show for Set[K] pub impl[K : Hash + Eq] Sub for Set[K] pub impl[X : ToJson] ToJson for Set[X] pub impl[K : @debug.Debug] @debug.Debug for Set[K]