Skip to content

Commit 31022b1

Browse files
authored
style: Sort imports (#4522)
1 parent 64cf7a3 commit 31022b1

Some content is hidden

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

68 files changed

+168
-204
lines changed

lutra/bindings/python/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#![cfg(not(target_family = "wasm"))]
22

3-
use arrow::{pyarrow::PyArrowType, record_batch::RecordBatch};
4-
use itertools::Itertools;
53
use std::str::FromStr;
64

5+
use arrow::{pyarrow::PyArrowType, record_batch::RecordBatch};
6+
use itertools::Itertools;
77
use pyo3::prelude::*;
88

99
#[pymodule]

prqlc/bindings/java/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
use std::str::FromStr;
2+
13
use jni::objects::{JClass, JString};
24
use jni::sys::{jboolean, jstring};
35
use jni::JNIEnv;
46
use prqlc::{json, pl_to_prql, prql_to_pl, ErrorMessages, Options, Target};
5-
use std::str::FromStr;
67

78
#[no_mangle]
89
#[allow(non_snake_case)]

prqlc/bindings/prqlc-c/src/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22

33
extern crate libc;
44

5-
use libc::{c_char, size_t};
6-
use prqlc::ErrorMessages;
7-
use prqlc::Target;
85
use std::ffi::CStr;
96
use std::ffi::CString;
107
use std::str::FromStr;
118

9+
use libc::{c_char, size_t};
10+
use prqlc::ErrorMessages;
11+
use prqlc::Target;
12+
1213
/// Compile a PRQL string into a SQL string.
1314
///
1415
/// This is a wrapper for: `prql_to_pl`, `pl_to_rq` and `rq_to_sql` without converting to JSON

prqlc/bindings/prqlc-python/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,10 @@ pub fn get_targets() -> Vec<String> {
134134
#[cfg(not(feature = "extension-module"))]
135135
#[cfg(test)]
136136
mod test {
137-
use super::*;
138137
use insta::assert_snapshot;
139138

139+
use super::*;
140+
140141
#[test]
141142
fn parse_for_python() {
142143
let opts = Some(CompileOptions {

prqlc/prqlc-ast/src/error.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,10 @@ impl<T, E: WithErrorInfo> WithErrorInfo for Result<T, E> {
191191

192192
#[cfg(test)]
193193
mod tests {
194-
use super::*;
195194
use insta::{assert_debug_snapshot, assert_snapshot};
196195

196+
use super::*;
197+
197198
// Helper function to create a simple Error object
198199
fn create_simple_error() -> Error {
199200
Error::new_simple("A simple error message")

prqlc/prqlc-ast/src/expr.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@ mod ident;
33
mod literal;
44
mod ops;
55

6-
pub use ident::Ident;
7-
pub use literal::{Literal, ValueAndUnit};
8-
pub use ops::{BinOp, UnOp};
9-
106
use std::collections::HashMap;
117

128
use enum_as_inner::EnumAsInner;
139
use serde::{Deserialize, Serialize};
1410

11+
pub use self::ident::Ident;
12+
pub use self::literal::{Literal, ValueAndUnit};
13+
pub use self::ops::{BinOp, UnOp};
1514
use crate::{Span, Ty};
1615

1716
impl Expr {

prqlc/prqlc-ast/src/span.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
use serde::de::Visitor;
2-
use serde::{Deserialize, Serialize};
31
use std::fmt::{self, Debug, Formatter};
42
use std::ops::Range;
53

4+
use serde::de::Visitor;
5+
use serde::{Deserialize, Serialize};
6+
67
#[derive(Clone, PartialEq, Eq, Copy)]
78
pub struct Span {
89
pub start: usize,

prqlc/prqlc-ast/src/types.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ use enum_as_inner::EnumAsInner;
22
use serde::{Deserialize, Serialize};
33
use strum::AsRefStr;
44

5-
use crate::{Ident, Span};
6-
75
use super::Literal;
6+
use crate::{Ident, Span};
87

98
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
109
pub struct Ty {

prqlc/prqlc-parser/src/expr.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
use std::collections::HashMap;
22

33
use chumsky::prelude::*;
4-
54
use prqlc_ast::expr::*;
65
use prqlc_ast::Span;
76

8-
use crate::types::type_expr;
9-
107
use super::common::*;
118
use super::interpolation;
129
use super::lexer::TokenKind;
1310
use super::span::ParserSpan;
11+
use crate::types::type_expr;
1412

1513
pub fn expr_call() -> impl Parser<TokenKind, Expr, Error = PError> {
1614
let expr = expr();

prqlc/prqlc-parser/src/interpolation.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ use chumsky::{error::Cheap, prelude::*};
22
use itertools::Itertools;
33
use prqlc_ast::expr::*;
44

5-
use crate::Span;
6-
75
use super::common::{into_expr, PError};
86
use super::lexer::*;
97
use super::span::ParserSpan;
8+
use crate::Span;
109

1110
/// Parses interpolated strings
1211
pub fn parse(string: String, span_base: ParserSpan) -> Result<Vec<InterpolateItem>, Vec<PError>> {

0 commit comments

Comments
 (0)