Skip to content

Commit 8f1a1d0

Browse files
committed
refactor: remove unnecessary paths in traits
1 parent a1367ba commit 8f1a1d0

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/lib.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,19 +115,19 @@ impl NonEmptyString {
115115
}
116116
}
117117

118-
impl std::convert::AsRef<str> for NonEmptyString {
118+
impl AsRef<str> for NonEmptyString {
119119
fn as_ref(&self) -> &str {
120120
&self.0
121121
}
122122
}
123123

124-
impl std::convert::AsRef<String> for NonEmptyString {
124+
impl AsRef<String> for NonEmptyString {
125125
fn as_ref(&self) -> &String {
126126
&self.0
127127
}
128128
}
129129

130-
impl<'s> std::convert::TryFrom<&'s str> for NonEmptyString {
130+
impl<'s> TryFrom<&'s str> for NonEmptyString {
131131
type Error = ();
132132

133133
fn try_from(value: &'s str) -> Result<Self, Self::Error> {
@@ -139,7 +139,7 @@ impl<'s> std::convert::TryFrom<&'s str> for NonEmptyString {
139139
}
140140
}
141141

142-
impl std::convert::TryFrom<String> for NonEmptyString {
142+
impl TryFrom<String> for NonEmptyString {
143143
type Error = String;
144144

145145
fn try_from(value: String) -> Result<Self, Self::Error> {
@@ -153,7 +153,6 @@ impl std::fmt::Display for NonEmptyString {
153153
}
154154
}
155155

156-
157156
#[cfg(test)]
158157
mod tests {
159158
use super::*;
@@ -198,13 +197,12 @@ mod tests {
198197
// `len` is a `String` method.
199198
assert!(nes.len() > 0);
200199
}
201-
200+
202201
#[test]
203202
fn format_test() {
204203
let str = NonEmptyString::new("string".to_owned()).unwrap();
205204
println!("{}", &str);
206-
205+
207206
let _str: String = str.to_string();
208207
}
209-
210208
}

0 commit comments

Comments
 (0)