Skip to content

Replace libbase's ReadFileToString#2406

Open
jemoreira wants to merge 1 commit intogoogle:mainfrom
jemoreira:read2str
Open

Replace libbase's ReadFileToString#2406
jemoreira wants to merge 1 commit intogoogle:mainfrom
jemoreira:read2str

Conversation

@jemoreira
Copy link
Copy Markdown
Member

with cuttlefish::ReadFileContents

Bug: b/503015117

with cuttlefish::ReadFileContents

Bug: b/503015117
@jemoreira jemoreira requested a review from Databean April 15, 2026 19:13
@jemoreira jemoreira enabled auto-merge April 15, 2026 19:13
&contents,
/* follow_symlinks */ true)) {
return contents;
auto contents = ReadFileContents(fmt::format("{}/{}", dir, path));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: Result<std::string>, not auto, following https://abseil.io/tips/232

std::string android_info;
if (!ReadFileToString(info_path, &android_info,
/* follow_symlinks */ true)) {
auto android_info_result = ReadFileContents(info_path);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: Result<std::string>, following https://abseil.io/tips/232

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