Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions hashmap/extends.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
22 changes: 0 additions & 22 deletions hashmap/hashmap_coverage_test.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -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([])")
}
2 changes: 0 additions & 2 deletions hashmap/pkg.generated.mbti
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
28 changes: 0 additions & 28 deletions hashmap/utils.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down
5 changes: 0 additions & 5 deletions set/extends.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
21 changes: 0 additions & 21 deletions set/linked_hash_set.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions set/pkg.generated.mbti
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Loading