about summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-04-16 03:22:21 +0000
committerbors <bors@rust-lang.org>2015-04-16 03:22:21 +0000
commit288809c8f35d9b37f2e4f5c3ac168f56dbc3bbc4 (patch)
tree2606f4c9c39c215161feb41a74348d7e07d79c1c /src/libstd/sys
parente40449e0d545561c73a9b9b324b5971b533a87b7 (diff)
parentc55ae1dc3094912c935fb95cf915841af0259305 (diff)
downloadrust-288809c8f35d9b37f2e4f5c3ac168f56dbc3bbc4.tar.gz
rust-288809c8f35d9b37f2e4f5c3ac168f56dbc3bbc4.zip
Auto merge of #23682 - tamird:DRY-is-empty, r=alexcrichton
r? @alexcrichton 
Diffstat (limited to 'src/libstd/sys')
-rw-r--r--src/libstd/sys/common/backtrace.rs4
-rw-r--r--src/libstd/sys/windows/process2.rs2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/libstd/sys/common/backtrace.rs b/src/libstd/sys/common/backtrace.rs
index cd118b3c9ee..580d970af0c 100644
--- a/src/libstd/sys/common/backtrace.rs
+++ b/src/libstd/sys/common/backtrace.rs
@@ -76,7 +76,7 @@ pub fn demangle(writer: &mut Write, s: &str) -> io::Result<()> {
         try!(writer.write_all(s.as_bytes()));
     } else {
         let mut first = true;
-        while inner.len() > 0 {
+        while !inner.is_empty() {
             if !first {
                 try!(writer.write_all(b"::"));
             } else {
@@ -89,7 +89,7 @@ pub fn demangle(writer: &mut Write, s: &str) -> io::Result<()> {
             let i: usize = inner[.. (inner.len() - rest.len())].parse().unwrap();
             inner = &rest[i..];
             rest = &rest[..i];
-            while rest.len() > 0 {
+            while !rest.is_empty() {
                 if rest.starts_with("$") {
                     macro_rules! demangle {
                         ($($pat:expr, => $demangled:expr),*) => ({
diff --git a/src/libstd/sys/windows/process2.rs b/src/libstd/sys/windows/process2.rs
index fdb47eb8c80..16c2a9125ea 100644
--- a/src/libstd/sys/windows/process2.rs
+++ b/src/libstd/sys/windows/process2.rs
@@ -381,7 +381,7 @@ fn make_command_line(prog: &OsStr, args: &[OsString]) -> Vec<u16> {
         // it will be dropped entirely when parsed on the other end.
         let arg_bytes = &arg.as_inner().inner.as_inner();
         let quote = arg_bytes.iter().any(|c| *c == b' ' || *c == b'\t')
-            || arg_bytes.len() == 0;
+            || arg_bytes.is_empty();
         if quote {
             cmd.push('"' as u16);
         }