Skip to content

Commit 059a816

Browse files
committed
fix: use a fully qualified path to specify the expected types
1 parent 4c609c4 commit 059a816

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "faststr"
3-
version = "0.2.30"
3+
version = "0.2.31"
44
authors = ["Volo Team <[email protected]>"]
55
edition = "2021"
66
description = "Faststr is a string library that reduces the cost of clone."

benches/faststr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ fn criterion_benchmark(c: &mut Criterion) {
2525
});
2626
drop(_s1);
2727
drop(_s2);
28-
let s = String::from("a".repeat(size));
28+
let s = "a".repeat(size);
2929
c.bench_function(format!("{}B string", size).as_str(), |b| {
3030
b.iter(|| black_box(s.clone()))
3131
});

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ impl<'a> PartialEq<&'a str> for FastStr {
379379
}
380380
}
381381

382-
impl<'a> PartialEq<FastStr> for &'a str {
382+
impl PartialEq<FastStr> for &str {
383383
#[inline]
384384
fn eq(&self, other: &FastStr) -> bool {
385385
*self == other
@@ -407,7 +407,7 @@ impl<'a> PartialEq<&'a String> for FastStr {
407407
}
408408
}
409409

410-
impl<'a> PartialEq<FastStr> for &'a String {
410+
impl PartialEq<FastStr> for &String {
411411
#[inline]
412412
fn eq(&self, other: &FastStr) -> bool {
413413
*self == other

src/sqlx_mysql.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ impl Encode<'_, MySql> for FastStr {
3434
<&str as Encode<MySql>>::encode(self.as_str(), buf)
3535
}
3636
fn size_hint(&self) -> usize {
37-
self.as_str().size_hint()
37+
<&str as Encode<MySql>>::size_hint(&self.as_str())
3838
}
3939
}

0 commit comments

Comments
 (0)