Skip to content

Refactor(Rust/Hello-world): Refactor functions and update dependencies for improved codebase #1137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

gianalarcon
Copy link
Contributor

@gianalarcon gianalarcon commented May 2, 2025

Overview
This PR makes several improvements to the codebase:

  1. The greet function:

    • Moves string formatting inside the with_borrow closure
    • Eliminates an unnecessary clone operation
    • Reduces memory overhead
  2. The set_greeting function:

    • Removes unnecessary braces in the closure
    • Maintains identical functionality with cleaner syntax
  3. Updates the ic-cdk dependency from version "0.16.0" to "0.18.0"

Considerations
What impact will this change have on security, performance, users (e.g. breaking changes) or the team (e.g. maintenance costs)?

Both changes maintain identical functionality while making the code more concise and idiomatic.

@gianalarcon gianalarcon requested a review from a team as a code owner May 2, 2025 00:09
@gianalarcon gianalarcon changed the title Refactor(Rust/Hello-world): Update greet function to improve code Refactor(Rust/Hello-world): Update greet and set_greeting function to improve code May 2, 2025
@gianalarcon gianalarcon changed the title Refactor(Rust/Hello-world): Update greet and set_greeting function to improve code Refactor(Rust/Hello-world): Update gree` and set_greeting functions to improve code clarity May 2, 2025
@gianalarcon gianalarcon changed the title Refactor(Rust/Hello-world): Update gree` and set_greeting functions to improve code clarity Refactor(Rust/Hello-world): Update greed and set_greeting functions to improve code clarity May 2, 2025
@gianalarcon gianalarcon changed the title Refactor(Rust/Hello-world): Update greed and set_greeting functions to improve code clarity Refactor(Rust/Hello-world): Refactor functions and update dependencies for improved codebase May 2, 2025
@sesi200
Copy link
Contributor

sesi200 commented May 8, 2025

Thank you very much @gianalarcon! This PR could be merged as-is, but the ICP Ninja backend currently still struggles with the new CDK version. Because of that I will not quite yet merge this PR. ETA: 1-2 weeks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants