Skip to content

Commit

Permalink
to_owned should be used in favor of to_string
Browse files Browse the repository at this point in the history
  • Loading branch information
leaexplores committed Sep 28, 2015
1 parent 7c9995e commit 1c3f102
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/declare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ method_decl_impl!(A, B, C, D, E, F, G, H, I, J, K);
method_decl_impl!(A, B, C, D, E, F, G, H, I, J, K, L);

fn method_type_encoding<F>() -> CString where F: MethodImplementation {
let mut types = F::Ret::encode().as_str().to_string();
let mut types = F::Ret::encode().as_str().to_owned();
types.extend(F::argument_encodings().iter().map(|e| e.as_str()));
CString::new(types).unwrap()
}
Expand Down
2 changes: 1 addition & 1 deletion src/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pub fn from_static_str(code: &'static str) -> Encoding {

pub fn from_str(code: &str) -> Encoding {
if code.len() > CODE_INLINE_CAP {
Encoding { code: Code::Owned(code.to_string()) }
Encoding { code: Code::Owned(code.to_owned()) }
} else {
let mut bytes = [0; CODE_INLINE_CAP];
for (dst, byte) in bytes.iter_mut().zip(code.bytes()) {
Expand Down
2 changes: 1 addition & 1 deletion src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub struct CustomStruct {

unsafe impl Encode for CustomStruct {
fn encode() -> Encoding {
let mut code = "{CustomStruct=".to_string();
let mut code = "{CustomStruct=".to_owned();
for _ in 0..4 {
code.push_str(u64::encode().as_str());
}
Expand Down

0 comments on commit 1c3f102

Please sign in to comment.