Skip to content

Commit 0dde85e

Browse files
committed
Auto-apply new import style in uncontroversial cases
Current settings: group_imports = "StdExternalCrate" imports_granularity = "Module"
1 parent 112d408 commit 0dde85e

File tree

206 files changed

+713
-554
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

206 files changed

+713
-554
lines changed

godot-bindings/src/godot_exe.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,17 @@
77

88
//! Commands related to Godot executable
99
10+
use std::fs;
11+
use std::path::{Path, PathBuf};
12+
use std::process::{Command, Output};
13+
14+
use regex::Regex;
15+
1016
use crate::godot_version::{parse_godot_version, validate_godot_version};
1117
use crate::header_gen::generate_rust_binding;
1218
use crate::watch::StopWatch;
1319
use crate::GodotVersion;
1420

15-
use regex::Regex;
16-
use std::fs;
17-
use std::path::{Path, PathBuf};
18-
use std::process::{Command, Output};
1921
// Note: CARGO_BUILD_TARGET_DIR and CARGO_TARGET_DIR are not set.
2022
// OUT_DIR would be standing to reason, but it's an unspecified path that cannot be referenced by CI.
2123
// const GODOT_VERSION_PATH: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/src/gen/godot_version.txt");

godot-bindings/src/godot_version.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99
// while all the functions included are used only with `custom-api` and `custom-api-json` features.
1010
#![cfg_attr(not(feature = "api-custom"), allow(unused_variables, dead_code))]
1111

12-
use crate::GodotVersion;
13-
use regex::{Captures, Regex};
1412
use std::error::Error;
1513
use std::str::FromStr;
1614

15+
use regex::{Captures, Regex};
16+
17+
use crate::GodotVersion;
18+
1719
pub fn parse_godot_version(version_str: &str) -> Result<GodotVersion, Box<dyn Error>> {
1820
// Format of the string emitted by `godot --version`:
1921
// https://github.com/godot-rust/gdext/issues/118#issuecomment-1465748123

godot-bindings/src/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ mod godot_version;
4848
#[cfg(feature = "api-custom")]
4949
#[path = ""]
5050
mod depend_on_custom {
51-
use super::*;
5251
use std::borrow::Cow;
5352

53+
use super::*;
54+
5455
pub(crate) mod godot_exe;
5556
pub(crate) mod godot_version;
5657
pub(crate) mod header_gen;
@@ -82,10 +83,10 @@ pub use depend_on_custom::*;
8283
#[cfg(feature = "api-custom-json")]
8384
#[path = ""]
8485
mod depend_on_custom_json {
85-
use super::*;
86-
8786
use std::borrow::Cow;
8887

88+
use super::*;
89+
8990
pub(crate) mod godot_json;
9091
pub(crate) mod godot_version;
9192
pub(crate) mod header_gen;

godot-bindings/src/watch.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@
66
*/
77

88
use std::fs::File;
9-
use std::io::BufWriter;
9+
use std::io::{BufWriter, Write};
1010
use std::path::Path;
1111
use std::time::{Duration, Instant};
1212

13-
use std::io::Write;
14-
1513
pub struct StopWatch {
1614
last_instant: Instant,
1715
metrics: Vec<Metric>,

godot-cell/src/borrow_state.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,11 @@ impl From<String> for BorrowStateErr {
300300

301301
#[cfg(all(test, feature = "proptest"))]
302302
mod proptests {
303+
use proptest::arbitrary::Arbitrary;
304+
use proptest::collection::vec;
305+
use proptest::prelude::*;
306+
303307
use super::*;
304-
use proptest::{arbitrary::Arbitrary, collection::vec, prelude::*};
305308

306309
impl BorrowState {
307310
fn has_shared_reference(&self) -> bool {

godot-cell/tests/mock/blocking.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
use std::collections::HashMap;
1313
use std::error::Error;
1414
use std::marker::PhantomData;
15-
use std::sync::{atomic::AtomicUsize, Mutex, OnceLock};
15+
use std::sync::atomic::AtomicUsize;
16+
use std::sync::{Mutex, OnceLock};
1617
use std::time::Duration;
1718

1819
use godot_cell::blocking::{GdCell, InaccessibleGuard};

godot-cell/tests/mock/panicking.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
use std::collections::HashMap;
1313
use std::error::Error;
1414
use std::marker::PhantomData;
15-
use std::sync::{atomic::AtomicUsize, Mutex, OnceLock};
15+
use std::sync::atomic::AtomicUsize;
16+
use std::sync::{Mutex, OnceLock};
1617

1718
use godot_cell::panicking::{GdCell, InaccessibleGuard};
1819

godot-codegen/src/context.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
66
*/
77

8+
use std::collections::{HashMap, HashSet};
9+
10+
use proc_macro2::{Ident, TokenStream};
11+
use quote::{format_ident, ToTokens};
12+
813
use crate::generator::method_tables::MethodTableKey;
914
use crate::generator::notifications;
1015
use crate::models::domain::{ArgPassing, GodotTy, RustTy, TyName};
@@ -13,9 +18,6 @@ use crate::models::json::{
1318
};
1419
use crate::util::option_as_slice;
1520
use crate::{special_cases, util, JsonExtensionApi};
16-
use proc_macro2::{Ident, TokenStream};
17-
use quote::{format_ident, ToTokens};
18-
use std::collections::{HashMap, HashSet};
1921

2022
#[derive(Default)]
2123
pub struct Context<'a> {

godot-codegen/src/conv/name_conversions.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77

88
//! Identifier renamings (Godot -> Rust)
99
10-
use crate::util::ident;
1110
use proc_macro2::Ident;
1211

12+
use crate::util::ident;
13+
1314
// ----------------------------------------------------------------------------------------------------------------------------------------------
1415
// Case conversions
1516

godot-codegen/src/conv/type_conversions.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77

88
//! Type and expression conversions (Godot -> Rust)
99
10+
use std::fmt;
11+
1012
use proc_macro2::{Ident, Literal, TokenStream};
1113
use quote::{quote, ToTokens};
12-
use std::fmt;
1314

1415
use crate::context::Context;
1516
use crate::conv;

0 commit comments

Comments
 (0)