Skip to content

Commit 4edf6fa

Browse files
committed
chore: small clippy fixes
1 parent d703a0d commit 4edf6fa

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

src/from_ref.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ pub trait FromRef<Borrowed: ?Sized> {
2323
// str
2424
impl FromRef<str> for Box<str> {
2525
fn from_ref(val: &str) -> Self {
26-
Box::from(val)
26+
Self::from(val)
2727
}
2828
}
2929
impl FromRef<str> for Rc<str> {
3030
fn from_ref(val: &str) -> Self {
31-
Rc::from(val)
31+
Self::from(val)
3232
}
3333
}
3434
impl FromRef<str> for Arc<str> {
3535
fn from_ref(val: &str) -> Self {
36-
Arc::from(val)
36+
Self::from(val)
3737
}
3838
}
3939
impl FromRef<str> for String {
@@ -45,17 +45,17 @@ impl FromRef<str> for String {
4545
// CStr
4646
impl FromRef<CStr> for Box<CStr> {
4747
fn from_ref(val: &CStr) -> Self {
48-
Box::from(val)
48+
Self::from(val)
4949
}
5050
}
5151
impl FromRef<CStr> for Rc<CStr> {
5252
fn from_ref(val: &CStr) -> Self {
53-
Rc::from(val)
53+
Self::from(val)
5454
}
5555
}
5656
impl FromRef<CStr> for Arc<CStr> {
5757
fn from_ref(val: &CStr) -> Self {
58-
Arc::from(val)
58+
Self::from(val)
5959
}
6060
}
6161
impl FromRef<CStr> for CString {
@@ -74,17 +74,17 @@ impl<T: Clone> FromRef<T> for T {
7474
// [T]
7575
impl<T: Clone> FromRef<[T]> for Box<[T]> {
7676
fn from_ref(val: &[T]) -> Self {
77-
Box::from(val)
77+
Self::from(val)
7878
}
7979
}
8080
impl<T: Clone> FromRef<[T]> for Rc<[T]> {
8181
fn from_ref(val: &[T]) -> Self {
82-
Rc::from(val)
82+
Self::from(val)
8383
}
8484
}
8585
impl<T: Clone> FromRef<[T]> for Arc<[T]> {
8686
fn from_ref(val: &[T]) -> Self {
87-
Arc::from(val)
87+
Self::from(val)
8888
}
8989
}
9090
impl<T: Clone> FromRef<[T]> for Vec<T> {
@@ -109,17 +109,17 @@ mod os_impls {
109109
// OsStr
110110
impl FromRef<OsStr> for Box<OsStr> {
111111
fn from_ref(val: &OsStr) -> Self {
112-
Box::from(val)
112+
Self::from(val)
113113
}
114114
}
115115
impl FromRef<OsStr> for Rc<OsStr> {
116116
fn from_ref(val: &OsStr) -> Self {
117-
Rc::from(val)
117+
Self::from(val)
118118
}
119119
}
120120
impl FromRef<OsStr> for Arc<OsStr> {
121121
fn from_ref(val: &OsStr) -> Self {
122-
Arc::from(val)
122+
Self::from(val)
123123
}
124124
}
125125
impl FromRef<OsStr> for OsString {
@@ -131,17 +131,17 @@ mod os_impls {
131131
// Path
132132
impl FromRef<Path> for Box<Path> {
133133
fn from_ref(val: &Path) -> Self {
134-
Box::from(val)
134+
Self::from(val)
135135
}
136136
}
137137
impl FromRef<Path> for Rc<Path> {
138138
fn from_ref(val: &Path) -> Self {
139-
Rc::from(val)
139+
Self::from(val)
140140
}
141141
}
142142
impl FromRef<Path> for Arc<Path> {
143143
fn from_ref(val: &Path) -> Self {
144-
Arc::from(val)
144+
Self::from(val)
145145
}
146146
}
147147
impl FromRef<Path> for PathBuf {

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ mod tests {
549549
let handle = interner.intern_ref(item.as_bytes()).unwrap();
550550
assert_eq!(interner.len(), 1);
551551
assert_eq!(
552-
interner.resolve(handle).map(|v| v.as_slice()),
552+
interner.resolve(handle).map(alloc::vec::Vec::as_slice),
553553
Some(item.as_bytes()),
554554
);
555555
}

0 commit comments

Comments
 (0)