Skip to content

Rename Host::check_same_env to Host::is_same#1555

Merged
dmkozh merged 2 commits into
mainfrom
host-is-same
May 19, 2025
Merged

Rename Host::check_same_env to Host::is_same#1555
dmkozh merged 2 commits into
mainfrom
host-is-same

Conversation

@leighmcculloch
Copy link
Copy Markdown
Member

@leighmcculloch leighmcculloch commented May 18, 2025

What

Rename the host comparison method from check_same_env to is_same, changing it to return a boolean instead of a Result.

Why

The new name better reflects the method's purpose of being used by the SDK to compare two Hosts and determine if they in fact are the same underlying host implementation. The check function returns a result with the host assuming that there is in fact an error, whilst the is function returns a bool, merely providing information to the SDK so that the SDK can then decide in the context of its use whether there is an error or a change in behaviour is required.

Close #1554

Related:

@leighmcculloch leighmcculloch requested a review from dmkozh May 18, 2025 21:51
@leighmcculloch leighmcculloch marked this pull request as ready for review May 18, 2025 21:54
Comment thread soroban-env-host/src/host.rs
@dmkozh dmkozh added this pull request to the merge queue May 19, 2025
Merged via the queue into main with commit a532072 May 19, 2025
14 checks passed
@dmkozh dmkozh deleted the host-is-same branch May 19, 2025 15:39
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.

Change check_same_env to is_same_env

3 participants