pw_status: Replace Status::Ok() with OkStatus()
- Mark Status::Ok() and StatusWithSize::Ok() as deprecated.
- Replace Status::Ok() with OkStatus().
- Replace StatusWithSize::Ok() with StatusWithSize().
Change-Id: If7192282446bf6d7f90990bb0b4f1b1b89a9228a
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/29003
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Keir Mierle <keir@google.com>
diff --git a/pw_kvs/entry_cache.cc b/pw_kvs/entry_cache.cc
index c63e349..e71d42e 100644
--- a/pw_kvs/entry_cache.cc
+++ b/pw_kvs/entry_cache.cc
@@ -107,7 +107,7 @@
} else if (key == read_key) {
PW_LOG_DEBUG("Found match for key hash 0x%08" PRIx32, hash);
*metadata = EntryMetadata(descriptors_[i], addresses(i));
- return StatusWithSize::Ok(error_val);
+ return StatusWithSize(error_val);
} else {
PW_LOG_WARN("Found key hash collision for 0x%08" PRIx32, hash);
return StatusWithSize::AlreadyExists(error_val);
@@ -142,14 +142,14 @@
return Status::ResourceExhausted();
}
AddNew(descriptor, address);
- return Status::Ok();
+ return OkStatus();
}
// Existing entry is old; replace the existing entry with the new one.
if (descriptor.transaction_id > descriptors_[index].transaction_id) {
descriptors_[index] = descriptor;
ResetAddresses(index, address);
- return Status::Ok();
+ return OkStatus();
}
// If the entries have a duplicate transaction ID, add the new (redundant)
@@ -177,7 +177,7 @@
} else {
PW_LOG_DEBUG("Found stale entry when appending; ignoring");
}
- return Status::Ok();
+ return OkStatus();
}
size_t EntryCache::present_entries() const {