Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dfinity/stable-structures
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.6.0-beta.1
Choose a base ref
...
head repository: dfinity/stable-structures
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.6.0-beta.2
Choose a head ref
  • 11 commits
  • 12 files changed
  • 4 contributors

Commits on Sep 21, 2023

  1. feat: Improve Error Handling by Adding Display Implementations (#140)

    This pull request aims to improve the error-handling mechanism of the
    codebase by providing more descriptive error messages. It involves
    changes across multiple files (`cell.rs`, `log.rs`) to add
    implementations for the `fmt::Display` trait for `InitError`.
    
    #### Key Changes:
    
    1. **Consistent Formatting**: Replaced `std::fmt` with `fmt` to maintain
    consistency in the code.
        - File: `btreemap.rs`
        
    2. **Enhanced Error Messages for `InitError` in `cell.rs`**: 
        - Describes errors related to incompatible versions and value sizes.
        
    3. **Detailed Error Messages for `InitError` in `log.rs`**: 
    - Explains issues with incompatible data and index versions, as well as
    invalid indices.
    
    #### Why this is important:
    
    Better error messages enhance the debugging experience and allow
    developers to understand the issues quickly, thereby saving time and
    effort.
    
    #### Files Changed:
    - `src/btreemap.rs`
    - `src/cell.rs`
    - `src/log.rs`
    
    #### Types of changes:
    - [x] Bugfix (non-breaking change which fixes an issue)
    - [x] New feature (non-breaking change which adds functionality)
    - [ ] Breaking change (fix or feature that would cause existing
    functionality to not work as expected)
    - [ ] Documentation Update (if none of the other choices apply)
    
    Co-authored-by: Islam El-Ashi <islam.elashi@dfinity.org>
    b3hr4d and ielashi authored Sep 21, 2023
    Configuration menu
    Copy the full SHA
    0375df2 View commit details
    Browse the repository at this point in the history

Commits on Sep 22, 2023

  1. feat: Enhance Bound Enum with Utility Methods and Refactor Storable T…

    …rait (#142)
    
    ### Description:
    
    This PR introduces utility methods to the `Bound` enum, enhancing its
    functionality and usability. These methods are used to refactor the
    `Storable` trait, making it cleaner and more maintainable.
    
    #### Use-Case:
    
    I am developing a library aimed at simplifying the use of stable memory
    structures. For example, consider a `TaskTimerEntry` struct defined as:
    
    ```rust
    pub struct TaskTimerEntry<T> {
        pub time: NanoTimeStamp,
        pub task: T,
    }
    ```
    
    To make this struct bounded, I can now easily specify:
    
    ```rust
    const BOUND: Bound = Bound::Bounded {
        is_fixed_size: false,
        max_size: 8 + T::BOUND.max_size(),
    };
    ```
    
    #### Key Changes:
    
    Introduced `max_size` and  `is_fixed_size` methods to `Bound` enum.
    
    #### Impact on `Storable` Trait:
    
    The utility methods have been integrated into the `Storable` trait,
    enhancing its readability and maintainability without altering its core
    functionality.
    
    #### Types of Changes:
    - [x] New feature (non-breaking change which adds functionality)
    - [ ] Bugfix (non-breaking change which fixes an issue)
    - [ ] Breaking change (fix or feature that would cause existing
    functionality to not work as expected)
    - [ ] Documentation Update (if none of the other choices apply)
    b3hr4d authored Sep 22, 2023
    Configuration menu
    Copy the full SHA
    4f7c8cb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f8a85c3 View commit details
    Browse the repository at this point in the history
  3. feat: impl Storable for Option<T: Storable> (#127)

    Co-authored-by: Roman Kashitsyn <roman.kashitsyn@gmail.com>
    witter-deland and roman-kashitsyn authored Sep 22, 2023
    Configuration menu
    Copy the full SHA
    5b51189 View commit details
    Browse the repository at this point in the history

Commits on Sep 25, 2023

  1. feat: comprehensive fuzzing for BTreeMap (#143)

    Adds a fuzz test that can run indefinitely comparing the results of a
    stable BTreeMap to a standard BTreeMap.
    
    I ended up using `proptest` rather than the conventional `cargo fuzz`
    for two reasons:
    
    1. `cargo fuzz` requires nightly rust.
    2. With proptest, we can have a short version of the fuzz test that runs
    as part of CI (which is included in this commit).
    ielashi authored Sep 25, 2023
    Configuration menu
    Copy the full SHA
    77d2a17 View commit details
    Browse the repository at this point in the history
  2. chore: remove redundant utility methods (#144)

    #142 introduced some utility methods in the `Bound` struct. We had
    copies of these utility methods elsewhere, which are no longer needed
    and are removed in this commit.
    ielashi authored Sep 25, 2023
    Configuration menu
    Copy the full SHA
    af272e4 View commit details
    Browse the repository at this point in the history

Commits on Sep 26, 2023

  1. docs: add docs on how to upgrade the schema of stable structures (#146)

    Adds a short doc on how attributes can be added to a stable structure.
    
    Closes #109
    ielashi authored Sep 26, 2023
    Configuration menu
    Copy the full SHA
    96ce8ab View commit details
    Browse the repository at this point in the history

Commits on Oct 2, 2023

  1. fix: support for migrating from bounded type to unbounded type. (#148)

    We'd like to support developers changing the bounds of their types from
    bounded to unbounded. There were some changes that needed to be made in
    this commit in order to make this migration work.
    ielashi authored Oct 2, 2023
    Configuration menu
    Copy the full SHA
    c880b83 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d422c2f View commit details
    Browse the repository at this point in the history

Commits on Oct 5, 2023

  1. feat: impl pop_last() & pop_first() for BTreeMap (#150)

    BtreeMap will support deque after this PR #106.
    And more methods for BTreeMap for #87
    
    ---------
    
    Co-authored-by: Islam El-Ashi <islam.elashi@dfinity.org>
    witter-deland and ielashi authored Oct 5, 2023
    Configuration menu
    Copy the full SHA
    16413ff View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ce317fb View commit details
    Browse the repository at this point in the history
Loading