Skip to content

Commit

Permalink
Squelch warnings
Browse files Browse the repository at this point in the history
Update .to_owned() to .to_string()

Turn off the non_snake_case_functions lint.
  • Loading branch information
lilyball committed Jun 4, 2014
1 parent 68f8930 commit be46e26
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#![feature(macro_rules)]

#![warn(missing_doc)]
#![allow(uppercase_variables)]
#![allow(uppercase_variables,non_snake_case_functions)]

extern crate libc;

Expand Down Expand Up @@ -1631,20 +1631,20 @@ impl<'l> RawState<'l> {

pub unsafe fn describe_(&mut self, idx: i32, usestack: bool) -> String {
match self.type_(idx) {
None => "".to_owned(),
None => "".to_string(),
Some(typ) => match typ {
Type::Nil => "nil".to_owned(),
Type::Boolean => if self.toboolean(idx) { "true".to_owned() }
else { "false".to_owned() },
Type::Nil => "nil".to_string(),
Type::Boolean => if self.toboolean(idx) { "true".to_string() }
else { "false".to_string() },
Type::Number => {
// Let Lua create the string instead of us
if usestack { self.pushvalue(idx); } // copy the value
let s = self.tostring(-1).map(|s| s.to_owned());
let s = self.tostring(-1).map(|s| s.to_string());
if usestack { self.pop(1); } // remove the copied value
s.unwrap_or_default() // default will be ~""
}
Type::String => {
self.tostring(idx).unwrap_or("<invalid utf8>").to_owned()
self.tostring(idx).unwrap_or("<invalid utf8>").to_string()
}
Type::LightUserdata |
Type::Userdata |
Expand Down

0 comments on commit be46e26

Please sign in to comment.