Fix warnings.

This commit is contained in:
levlam 2023-10-30 16:54:39 +03:00
parent 24b09ce83d
commit bdbee0765b
2 changed files with 3 additions and 3 deletions

View File

@ -96,7 +96,7 @@ BENCH(ToStringIntBig, "to_string<int> big") {
BENCH(TlToStringUpdateFile, "TL to_string updateFile") {
auto x = td::td_api::make_object<td::td_api::updateFile>(get_file_object());
td::uint32 res = 0;
std::size_t res = 0;
for (int i = 0; i < n; i++) {
res += to_string(x).size();
}
@ -119,7 +119,7 @@ BENCH(TlToStringMessage, "TL to_string message") {
x->content_ = td::td_api::make_object<td::td_api::messagePhoto>(
std::move(photo), td::td_api::make_object<td::td_api::formattedText>(), false, false);
td::uint32 res = 0;
std::size_t res = 0;
for (int i = 0; i < n; i++) {
res += to_string(x).size();
}

View File

@ -1221,7 +1221,7 @@ TEST(MessageEntities, is_visible_url) {
td::string str = "a telegram.org telegran.org telegrao.org telegram.orc telegrap.org c";
td::vector<td::MessageEntity> entities;
entities.emplace_back(td::MessageEntity::Type::TextUrl, 0, 1, "telegrab.org");
entities.emplace_back(td::MessageEntity::Type::TextUrl, str.size() - 1, 1, "telegrax.org");
entities.emplace_back(td::MessageEntity::Type::TextUrl, static_cast<td::int32>(str.size()) - 1, 1, "telegrax.org");
td::fix_formatted_text(str, entities, false, false, false, false, true).ensure();
td::FormattedText text{std::move(str), std::move(entities)};
ASSERT_EQ(td::get_first_url(text), "telegrab.org");