Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Depreciated legacy tree map #963

Merged
merged 6 commits into from
Nov 29, 2022
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
3 changes: 3 additions & 0 deletions near-sdk/src/collections/legacy_tree_map.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
//! Legacy `TreeMap` implementation that is using `UnorderedMap`.
//! DEPRECATED. This implementation is deprecated and may be removed in the future.
#![allow(clippy::all)]
// This suppresses the depreciation warnings for uses of LegacyTreeMap in this module
#![allow(deprecated)]

use borsh::{BorshDeserialize, BorshSerialize};
use std::ops::Bound;
Expand All @@ -18,6 +20,7 @@ use crate::IntoStorageKey;
/// - `above`/`below`: O(log(N))
/// - `range` of K elements: O(Klog(N))
///
#[deprecated(since = "4.1.0", note = "Use near_sdk::collections::TreeMap")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noting that the since "4.1.0" is a bit unideal, but given we don't really have a plan what will be the next minor/major version, and no one uses this, it's probably fine

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So yeah, how do we feel about depreciations? Are the major release only, or do we just do it whenever?

#[derive(BorshSerialize, BorshDeserialize)]
pub struct LegacyTreeMap<K, V> {
root: u64,
Expand Down
1 change: 1 addition & 0 deletions near-sdk/src/collections/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
//! that seemlessly integrated with the rest of the Rust standard library.

mod legacy_tree_map;
#[allow(deprecated)]
pub use legacy_tree_map::LegacyTreeMap;

mod lookup_map;
Expand Down