Skip to content

Commit c1c187b

Browse files
Auto-format: cargo fmt --all
1 parent cf07365 commit c1c187b

File tree

3 files changed

+43
-11
lines changed

3 files changed

+43
-11
lines changed

crates/stdlib/src/lib.rs

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ mod sha512;
3434

3535
mod json;
3636

37-
#[cfg(all(feature = "host_env", not(any(target_os = "ios", target_arch = "wasm32"))))]
37+
#[cfg(all(
38+
feature = "host_env",
39+
not(any(target_os = "ios", target_arch = "wasm32"))
40+
))]
3841
mod locale;
3942

4043
mod _opcode;
@@ -90,14 +93,27 @@ mod scproxy;
9093
#[cfg(all(feature = "host_env", any(unix, windows, target_os = "wasi")))]
9194
mod select;
9295

93-
#[cfg(all(feature = "host_env", not(target_arch = "wasm32"), feature = "ssl-openssl"))]
96+
#[cfg(all(
97+
feature = "host_env",
98+
not(target_arch = "wasm32"),
99+
feature = "ssl-openssl"
100+
))]
94101
mod openssl;
95-
#[cfg(all(feature = "host_env", not(target_arch = "wasm32"), feature = "ssl-rustls"))]
102+
#[cfg(all(
103+
feature = "host_env",
104+
not(target_arch = "wasm32"),
105+
feature = "ssl-rustls"
106+
))]
96107
mod ssl;
97108
#[cfg(all(feature = "ssl-openssl", feature = "ssl-rustls"))]
98109
compile_error!("features \"ssl-openssl\" and \"ssl-rustls\" are mutually exclusive");
99110

100-
#[cfg(all(feature = "host_env", unix, not(target_os = "redox"), not(target_os = "ios")))]
111+
#[cfg(all(
112+
feature = "host_env",
113+
unix,
114+
not(target_os = "redox"),
115+
not(target_os = "ios")
116+
))]
101117
mod termios;
102118
#[cfg(all(
103119
feature = "host_env",
@@ -147,7 +163,10 @@ pub fn stdlib_module_defs(ctx: &Context) -> Vec<&'static builtins::PyModuleDef>
147163
grp::module_def(ctx),
148164
hashlib::module_def(ctx),
149165
json::module_def(ctx),
150-
#[cfg(all(feature = "host_env", not(any(target_os = "ios", target_arch = "wasm32"))))]
166+
#[cfg(all(
167+
feature = "host_env",
168+
not(any(target_os = "ios", target_arch = "wasm32"))
169+
))]
151170
locale::module_def(ctx),
152171
#[cfg(not(any(target_os = "android", target_arch = "wasm32")))]
153172
lzma::module_def(ctx),
@@ -157,7 +176,11 @@ pub fn stdlib_module_defs(ctx: &Context) -> Vec<&'static builtins::PyModuleDef>
157176
mmap::module_def(ctx),
158177
#[cfg(all(feature = "host_env", not(target_arch = "wasm32")))]
159178
multiprocessing::module_def(ctx),
160-
#[cfg(all(feature = "host_env", not(target_arch = "wasm32"), feature = "ssl-openssl"))]
179+
#[cfg(all(
180+
feature = "host_env",
181+
not(target_arch = "wasm32"),
182+
feature = "ssl-openssl"
183+
))]
161184
openssl::module_def(ctx),
162185
#[cfg(all(feature = "host_env", windows))]
163186
overlapped::module_def(ctx),
@@ -190,13 +213,21 @@ pub fn stdlib_module_defs(ctx: &Context) -> Vec<&'static builtins::PyModuleDef>
190213
not(any(target_os = "android", target_arch = "wasm32"))
191214
))]
192215
_sqlite3::module_def(ctx),
193-
#[cfg(all(feature = "host_env", not(target_arch = "wasm32"), feature = "ssl-rustls"))]
216+
#[cfg(all(
217+
feature = "host_env",
218+
not(target_arch = "wasm32"),
219+
feature = "ssl-rustls"
220+
))]
194221
ssl::module_def(ctx),
195222
statistics::module_def(ctx),
196223
suggestions::module_def(ctx),
197224
#[cfg(all(feature = "host_env", unix, not(target_os = "redox")))]
198225
syslog::module_def(ctx),
199-
#[cfg(all(feature = "host_env", unix, not(any(target_os = "ios", target_os = "redox"))))]
226+
#[cfg(all(
227+
feature = "host_env",
228+
unix,
229+
not(any(target_os = "ios", target_os = "redox"))
230+
))]
200231
termios::module_def(ctx),
201232
#[cfg(all(feature = "host_env", feature = "tkinter"))]
202233
tkinter::module_def(ctx),

crates/vm/src/stdlib/sys.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use crate::{Py, PyPayload, PyResult, VirtualMachine, builtins::PyModule, convert::ToPyObject};
22

3-
pub(crate) use sys::{DOC, MAXSIZE, RUST_MULTIARCH, UnraisableHookArgsData, module_def, multiarch};
43
#[cfg(all(not(feature = "host_env"), feature = "stdio"))]
54
pub(crate) use sys::SandboxStdio;
5+
pub(crate) use sys::{DOC, MAXSIZE, RUST_MULTIARCH, UnraisableHookArgsData, module_def, multiarch};
66

77
#[pymodule(name = "_jit")]
88
mod sys_jit {

crates/vm/src/vm/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,9 @@ impl VirtualMachine {
389389

390390
// No stdio: set to None (embedding use case)
391391
#[cfg(not(feature = "stdio"))]
392-
let make_stdio =
393-
|_name: &str, _fd: i32, _write: bool| Ok(crate::builtins::PyNone.into_pyobject(self));
392+
let make_stdio = |_name: &str, _fd: i32, _write: bool| {
393+
Ok(crate::builtins::PyNone.into_pyobject(self))
394+
};
394395

395396
let set_stdio = |name, fd, write| {
396397
let stdio: PyObjectRef = make_stdio(name, fd, write)?;

0 commit comments

Comments
 (0)