style: auto-format entire codebase with cargo fmt (stable rustfmt.toml)
Some checks failed
ci/woodpecker/pr/check Pipeline failed
CI / Check (pull_request) Has been cancelled
CI / Format (pull_request) Has been cancelled
CI / Clippy (pull_request) Has been cancelled
CI / Build (macos-latest) (pull_request) Has been cancelled
CI / Build (ubuntu-latest) (pull_request) Has been cancelled
CI / Build (windows-latest) (pull_request) Has been cancelled
Some checks failed
ci/woodpecker/pr/check Pipeline failed
CI / Check (pull_request) Has been cancelled
CI / Format (pull_request) Has been cancelled
CI / Clippy (pull_request) Has been cancelled
CI / Build (macos-latest) (pull_request) Has been cancelled
CI / Build (ubuntu-latest) (pull_request) Has been cancelled
CI / Build (windows-latest) (pull_request) Has been cancelled
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use criterion::{black_box, criterion_group, criterion_main, Criterion};
|
||||
use tele_tui::formatting::format_text_with_entities;
|
||||
use tdlib_rs::enums::{TextEntity, TextEntityType};
|
||||
use tele_tui::formatting::format_text_with_entities;
|
||||
|
||||
fn create_text_with_entities() -> (String, Vec<TextEntity>) {
|
||||
let text = "This is bold and italic text with code and a link and mention".to_string();
|
||||
@@ -41,9 +41,7 @@ fn benchmark_format_simple_text(c: &mut Criterion) {
|
||||
let entities = vec![];
|
||||
|
||||
c.bench_function("format_simple_text", |b| {
|
||||
b.iter(|| {
|
||||
format_text_with_entities(black_box(&text), black_box(&entities))
|
||||
});
|
||||
b.iter(|| format_text_with_entities(black_box(&text), black_box(&entities)));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -51,9 +49,7 @@ fn benchmark_format_markdown_text(c: &mut Criterion) {
|
||||
let (text, entities) = create_text_with_entities();
|
||||
|
||||
c.bench_function("format_markdown_text", |b| {
|
||||
b.iter(|| {
|
||||
format_text_with_entities(black_box(&text), black_box(&entities))
|
||||
});
|
||||
b.iter(|| format_text_with_entities(black_box(&text), black_box(&entities)));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -77,9 +73,7 @@ fn benchmark_format_long_text(c: &mut Criterion) {
|
||||
}
|
||||
|
||||
c.bench_function("format_long_text_with_100_entities", |b| {
|
||||
b.iter(|| {
|
||||
format_text_with_entities(black_box(&text), black_box(&entities))
|
||||
});
|
||||
b.iter(|| format_text_with_entities(black_box(&text), black_box(&entities)));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user