Skip to content

Localize tools.#922

Merged
BillyONeal merged 1 commit intomicrosoft:mainfrom
BillyONeal:localize-tools
Feb 22, 2023
Merged

Localize tools.#922
BillyONeal merged 1 commit intomicrosoft:mainfrom
BillyONeal:localize-tools

Conversation

@BillyONeal
Copy link
Copy Markdown
Member

No description provided.

msg::format_error(msgUnexpectedToolOutput, msg::tool_name = tool_name, msg::path = exe_path).extract_data();
error_prefix.push_back('\n');
return {std::move(error_prefix) + std::move(output), expected_right_tag};
return std::move(msg::format_error(msgUnexpectedToolOutput, msg::tool_name = tool_name, msg::path = exe_path)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why does this all need to be wrapped in a std::move() -- isn't it already an rvalue?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

LocalizedString::append returns LocalizedString&, not LocalizedString&&.

return {std::move(error_prefix) + std::move(output), expected_right_tag};
return std::move(msg::format_error(msgUnexpectedToolOutput, msg::tool_name = tool_name, msg::path = exe_path)
.append_raw('\n')
.append_raw(std::move(output)));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think this move does nothing

error.append(msg::format(msgMonoInstructions).extract_data());
return std::move(error);
.map_error([](LocalizedString&& error) {
return std::move(error.append_raw('\n').append(msg::format(msgMonoInstructions)));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think this move needs to be rescoped:

Suggested change
return std::move(error.append_raw('\n').append(msg::format(msgMonoInstructions)));
return std::move(error).append_raw('\n').append(msgMonoInstructions);

@BillyONeal BillyONeal merged commit 9927605 into microsoft:main Feb 22, 2023
@BillyONeal BillyONeal deleted the localize-tools branch February 22, 2023 22:14
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