Skip to content

Commit

Permalink
style(objectarium): improve style a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
ccamel committed Apr 28, 2023
1 parent c28f3eb commit 8e8c5ca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions contracts/okp4-objectarium/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,18 @@ pub enum ExecuteMsg {
/// the object cannot be removed (forget) from the storage.
///
/// The "compression_algorithm" parameter specifies the algorithm for compressing the object before
/// storing it in the storage, which is optional. If no algorithm is specified, the object is stored
/// as it is without any compression. The chosen algorithm can save storage space, but it will increase
/// CPU usage. Depending on the chosen compression algorithm and the achieved compression ratio, the gas
/// cost of the operation will vary, either increasing or decreasing.
/// storing it in the storage, which is optional. If no algorithm is specified, the algorithm used
/// is the first algorithm of the bucket configuration limits. Note that the chosen algorithm can
/// save storage space, but it will increase CPU usage. Depending on the chosen compression algorithm
/// and the achieved compression ratio, the gas cost of the operation will vary, either increasing or decreasing.
StoreObject {
/// The content of the object to store.
data: Binary,
/// Specifies if the object should be pinned for the sender.
pin: bool,
/// Specifies the compression algorithm to use when storing the object.
/// If None, the first algorithm of the bucket configuration limits is used.
/// If None, the first algorithm specified in the list of accepted compression algorithms of the bucket
/// is used (see [BucketLimits::accepted_compression_algorithms]).
compression_algorithm: Option<CompressionAlgorithm>,
},

Expand Down
2 changes: 1 addition & 1 deletion contracts/okp4-objectarium/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ impl From<msg::BucketLimits> for BucketLimits {
max_object_pins: limits.max_object_pins,
accepted_compression_algorithms: limits
.accepted_compression_algorithms
.map(|it| it.into_iter().map(|a| a.into()).collect::<Vec<_>>())
.map(|it| it.into_iter().map(Into::into).collect())
.unwrap_or_else(CompressionAlgorithm::values),
}
}
Expand Down

0 comments on commit 8e8c5ca

Please sign in to comment.