From 17778ba1b4719ce518cf92fe657b74de4c7b61c2 Mon Sep 17 00:00:00 2001 From: jD91mZM2 <me@krake.one> Date: Mon, 2 Jul 2018 07:42:33 +0200 Subject: [PATCH] Remove missing rustfmt.toml options --- Cargo.lock | 1 + fmt.sh | 2 +- rustfmt.toml | 6 ------ src/wchar/src/lib.rs | 12 ++++++------ src/wchar/src/utf8.rs | 2 -- 5 files changed, 8 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bd50ab871..23d4c6e1a 100644 --- a/Cargo.lock +++ b/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", ] diff --git a/fmt.sh b/fmt.sh index 4e2cf0508..cb5a928a3 100755 --- a/fmt.sh +++ b/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) diff --git a/rustfmt.toml b/rustfmt.toml index d52a68e96..5780cc6e0 100644 --- a/rustfmt.toml +++ b/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 diff --git a/src/wchar/src/lib.rs b/src/wchar/src/lib.rs index d08f4d235..31ae9667f 100644 --- a/src/wchar/src/lib.rs +++ b/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; diff --git a/src/wchar/src/utf8.rs b/src/wchar/src/utf8.rs index 5cd639f81..52166210f 100644 --- a/src/wchar/src/utf8.rs +++ b/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; -- GitLab