workspace: replace map().unwrap_or() with map_or() across codebase#12877
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
@liorgold2 note - these were Result not Option Code quote: storage_stats.as_ref().ok().map(|s| s.column_values()), |
liorgold2
left a comment
There was a problem hiding this comment.
@liorgold2 reviewed 9 files and all commit messages, and made 3 comments.
Reviewable status: 9 of 11 files reviewed, 4 unresolved discussions (waiting on dan-starkware).
crates/apollo_class_manager/src/class_manager.rs line 88 at r1 (raw file):
compiled_class_hash = %executable_class_hash_v2, compilation_elapsed_ms = compilation_start_time.elapsed().as_millis(), class_size_bytes = class.size().map_or("Failed to get class size".to_owned(), |size| size.to_string()),
These lines are more than 100 characters. Don't we have a linter for this?
crates/apollo_consensus_orchestrator/src/sequencer_consensus_context.rs line 768 at r1 (raw file):
round: Round, ) -> Result<(), ConsensusError> { if self.current_height.map_or(true, |h| height > h) {
Add a comment above the if explaining the condition.
crates/bench_tools/src/runner.rs line 139 at r1 (raw file):
for bench in benchmarks { let benchmark_names: Vec<&str> = bench.criterion_benchmark_names.map(|names| names.to_vec()).unwrap_or(vec![bench.name]);
What's the type of names?
liorgold2
left a comment
There was a problem hiding this comment.
@liorgold2 reviewed 2 files.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on dan-starkware).
b459802 to
be02b48
Compare
dan-starkware
left a comment
There was a problem hiding this comment.
@dan-starkware made 3 comments, resolved 1 discussion, and dismissed @liorgold2 from a discussion.
Reviewable status: 7 of 11 files reviewed, 3 unresolved discussions (waiting on liorgold2).
crates/apollo_class_manager/src/class_manager.rs line 88 at r1 (raw file):
Previously, liorgold2 wrote…
These lines are more than 100 characters. Don't we have a linter for this?
We do
crates/apollo_consensus_orchestrator/src/sequencer_consensus_context.rs line 768 at r1 (raw file):
Previously, liorgold2 wrote…
Add a comment above the
ifexplaining the condition.
Done.
crates/bench_tools/src/runner.rs line 139 at r1 (raw file):
Previously, liorgold2 wrote…
What's the type of
names?
bench.name: &'static str,
/// Optional list of Criterion benchmark names that this benchmark suite produces.
/// If None, assumes a single benchmark with the same name as the config.
/// Used for regression checking to know which criterion directories to check.
bench.criterion_benchmark_names: Option<&'static \[&'static str\]>,
dan-starkware
left a comment
There was a problem hiding this comment.
@dan-starkware resolved 1 discussion.
Reviewable status: 7 of 11 files reviewed, 2 unresolved discussions (waiting on liorgold2).
liorgold2
left a comment
There was a problem hiding this comment.
@liorgold2 reviewed 4 files and all commit messages, made 1 comment, and resolved 2 discussions.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on dan-starkware).

No description provided.