Skip to content

Commit

Permalink
Bump to 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
aarkegz committed Dec 5, 2024
1 parent 02db4d8 commit 090dced
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "flatten_objects"
version = "0.1.0"
version = "0.2.0"
edition = "2024"
authors = ["Yuekai Jia <[email protected]>"]
description = "A container that stores numbered objects. Each object can be assigned with a unique ID."
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ impl<T, const CAP: usize> FlattenObjects<T, CAP> {
/// assert_eq!(objects.add_at(20, 42), Err(42));
/// ```
pub fn add_at(&mut self, id: usize, value: T) -> Result<usize, T> {
if self.is_assigned(id) || id >= CAP {
if id >= CAP || self.is_assigned(id) {
return Err(value);
}
self.count += 1;
Expand Down

0 comments on commit 090dced

Please sign in to comment.