Forráskód Böngészése

Remove missing rustfmt.toml options

jD91mZM2 6 éve
szülő
commit
17778ba1b4
5 módosított fájl, 8 hozzáadás és 15 törlés
  1. 1 0
      Cargo.lock
  2. 1 1
      fmt.sh
  3. 0 6
      rustfmt.toml
  4. 6 6
      src/wchar/src/lib.rs
  5. 0 2
      src/wchar/src/utf8.rs

+ 1 - 0
Cargo.lock

@@ -419,6 +419,7 @@ dependencies = [
  "platform 0.1.0",
  "ralloc 1.0.0",
  "rand 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "string 0.1.0",
  "time 0.1.0",
  "wchar 0.1.0",
 ]

+ 1 - 1
fmt.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 ARGS=()
 
 for crate in relibc $(find src -name Cargo.toml | cut -d '/' -f2 | grep -v template)

+ 0 - 6
rustfmt.toml

@@ -9,19 +9,13 @@ fn_single_line = false
 where_single_line = false
 imports_indent = "Visual"
 imports_layout = "Mixed"
-reorder_extern_crates = true
-reorder_extern_crates_in_group = true
 reorder_imports = false
-reorder_imported_names = true
-spaces_within_parens_and_brackets = false
-remove_blank_lines_at_start_or_end_of_block = true
 fn_args_density = "Tall"
 brace_style = "SameLineWhere"
 trailing_comma = "Vertical"
 blank_lines_upper_bound = 1
 blank_lines_lower_bound = 0
 force_explicit_abi = true
-write_mode = "Overwrite"
 disable_all_formatting = false
 skip_children = false
 hide_parse_errors = false

+ 6 - 6
src/wchar/src/lib.rs

@@ -27,7 +27,7 @@ const MB_LEN_MAX: c_int = 4;
 
 #[repr(C)]
 #[derive(Clone, Copy)]
-pub struct mbstate_t {}
+pub struct mbstate_t;
 
 #[no_mangle]
 pub unsafe extern "C" fn btowc(c: c_int) -> wint_t {
@@ -38,7 +38,7 @@ pub unsafe extern "C" fn btowc(c: c_int) -> wint_t {
 
     let uc = c as u8;
     let c = uc as c_char;
-    let mut ps: mbstate_t = mbstate_t {};
+    let mut ps: mbstate_t = mbstate_t;
     let mut wc: wchar_t = 0;
     let saved_errno = platform::errno;
     let status = mbrtowc(&mut wc, &c as (*const c_char), 1, &mut ps);
@@ -52,7 +52,7 @@ pub unsafe extern "C" fn btowc(c: c_int) -> wint_t {
 #[no_mangle]
 pub unsafe extern "C" fn fputwc(wc: wchar_t, stream: *mut FILE) -> wint_t {
     //Convert wchar_t to multibytes first
-    static mut INTERNAL: mbstate_t = mbstate_t {};
+    static mut INTERNAL: mbstate_t = mbstate_t;
     let mut bytes: [c_char; MB_CUR_MAX as usize] = [0; MB_CUR_MAX as usize];
 
     let amount = wcrtomb(bytes.as_mut_ptr(), wc, &mut INTERNAL);
@@ -96,7 +96,7 @@ pub unsafe extern "C" fn mbsinit(ps: *const mbstate_t) -> c_int {
 
 #[no_mangle]
 pub unsafe extern "C" fn mbrlen(s: *const c_char, n: usize, ps: *mut mbstate_t) -> usize {
-    static mut INTERNAL: mbstate_t = mbstate_t {};
+    static mut INTERNAL: mbstate_t = mbstate_t;
     mbrtowc(ptr::null_mut(), s, n, &mut INTERNAL)
 }
 
@@ -108,7 +108,7 @@ pub unsafe extern "C" fn mbrtowc(
     n: usize,
     ps: *mut mbstate_t,
 ) -> usize {
-    static mut INTERNAL: mbstate_t = mbstate_t {};
+    static mut INTERNAL: mbstate_t = mbstate_t;
 
     if ps.is_null() {
         let ps = &mut INTERNAL;
@@ -131,7 +131,7 @@ pub unsafe extern "C" fn mbsnrtowcs(
     dst_len: usize,
     ps: *mut mbstate_t,
 ) -> usize {
-    static mut INTERNAL: mbstate_t = mbstate_t {};
+    static mut INTERNAL: mbstate_t = mbstate_t;
 
     if ps.is_null() {
         let ps = &mut INTERNAL;

+ 0 - 2
src/wchar/src/utf8.rs

@@ -1,8 +1,6 @@
 //UTF implementation parts for wchar.h.
 //Partially ported from the Sortix libc
 
-#![no_std]
-
 extern crate errno;
 extern crate platform;