Skip to content

Commit 1c3f102

Browse files
committed
to_owned should be used in favor of to_string
1 parent 7c9995e commit 1c3f102

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/declare.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ method_decl_impl!(A, B, C, D, E, F, G, H, I, J, K);
135135
method_decl_impl!(A, B, C, D, E, F, G, H, I, J, K, L);
136136

137137
fn method_type_encoding<F>() -> CString where F: MethodImplementation {
138-
let mut types = F::Ret::encode().as_str().to_string();
138+
let mut types = F::Ret::encode().as_str().to_owned();
139139
types.extend(F::argument_encodings().iter().map(|e| e.as_str()));
140140
CString::new(types).unwrap()
141141
}

src/encode.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ pub fn from_static_str(code: &'static str) -> Encoding {
7777

7878
pub fn from_str(code: &str) -> Encoding {
7979
if code.len() > CODE_INLINE_CAP {
80-
Encoding { code: Code::Owned(code.to_string()) }
80+
Encoding { code: Code::Owned(code.to_owned()) }
8181
} else {
8282
let mut bytes = [0; CODE_INLINE_CAP];
8383
for (dst, byte) in bytes.iter_mut().zip(code.bytes()) {

src/test_utils.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub struct CustomStruct {
2424

2525
unsafe impl Encode for CustomStruct {
2626
fn encode() -> Encoding {
27-
let mut code = "{CustomStruct=".to_string();
27+
let mut code = "{CustomStruct=".to_owned();
2828
for _ in 0..4 {
2929
code.push_str(u64::encode().as_str());
3030
}

0 commit comments

Comments
 (0)