]> git.lizzy.rs Git - rust.git/commitdiff
codegen_llvm_back: simplify a conversion to char
authorljedrz <ljedrz@gmail.com>
Mon, 29 Oct 2018 09:19:09 +0000 (10:19 +0100)
committerljedrz <ljedrz@gmail.com>
Sat, 10 Nov 2018 18:25:25 +0000 (19:25 +0100)
src/librustc_codegen_llvm/back/link.rs

index 5e12c70753c3eb8fb3b8e4026973aa207daafaec..111637b6aa967800090441756dced4a984e29572 100644 (file)
@@ -806,7 +806,7 @@ fn escape_string(s: &[u8]) -> String {
                         let mut x = "Non-UTF-8 output: ".to_string();
                         x.extend(s.iter()
                                   .flat_map(|&b| ascii::escape_default(b))
-                                  .map(|b| char::from_u32(b as u32).unwrap()));
+                                  .map(char::from));
                         x
                     })
             }