Skip to content

refactor: Simplify command state update methods#3309

Merged
didier-wenzek merged 3 commits intothin-edge:mainfrom
didier-wenzek:refactor/simplify_command_state_updates
Dec 19, 2024
Merged

refactor: Simplify command state update methods#3309
didier-wenzek merged 3 commits intothin-edge:mainfrom
didier-wenzek:refactor/simplify_command_state_updates

Conversation

@didier-wenzek
Copy link
Copy Markdown
Contributor

Proposed changes

Address comments raised on #3307

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (general improvements like code refactoring that doesn't explicitly fix a bug or add any new functionality)
  • Documentation Update (if none of the other choices apply)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Paste Link to the issue

#3307

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA (in all commits with git commit -s)
  • I ran cargo fmt as mentioned in CODING_GUIDELINES
  • I used cargo clippy as mentioned in CODING_GUIDELINES
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 19, 2024

Codecov Report

Attention: Patch coverage is 54.71698% with 24 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/core/tedge_api/src/workflow/supervisor.rs 28.57% 9 Missing and 1 partial ⚠️
crates/core/tedge_api/src/workflow/state.rs 66.66% 5 Missing and 3 partials ⚠️
...ore/tedge_agent/src/operation_workflows/persist.rs 44.44% 5 Missing ⚠️
crates/core/tedge_api/src/workflow/mod.rs 50.00% 1 Missing ⚠️
Additional details and impacted files

📢 Thoughts on this report? Let us know!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 19, 2024

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
551 0 2 551 100 1h31m8.521846s

operation: &OperationType,
command_state: GenericCommandState,
) -> Result<Option<GenericCommandState>, WorkflowExecutionError> {
let operation_name = operation.to_string();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor: I think to_owned better signifies the intent here

Suggested change
let operation_name = operation.to_string();
let operation_name = operation.to_owned();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

to_owned() is not appropriate here.

To convey the intent, I replaced to_string() by name(): 33268b9

Signed-off-by: Didier Wenzek <didier.wenzek@free.fr>
Signed-off-by: Didier Wenzek <didier.wenzek@free.fr>
In order to better convey the intent.

Signed-off-by: Didier Wenzek <didier.wenzek@free.fr>
@didier-wenzek didier-wenzek force-pushed the refactor/simplify_command_state_updates branch from 33268b9 to b9fea1b Compare December 19, 2024 17:03
@didier-wenzek didier-wenzek added this pull request to the merge queue Dec 19, 2024
Merged via the queue into thin-edge:main with commit b843d72 Dec 19, 2024
@didier-wenzek didier-wenzek deleted the refactor/simplify_command_state_updates branch December 19, 2024 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants