Skip to content

Commit b1a59aa

Browse files
committed
Formatting.
1 parent a83608b commit b1a59aa

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

macros/src/error.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
use proc_macro2::{Span, TokenStream};
2-
use quote::{quote, quote_spanned};
32
use pyo3::type_object::PyTypeObject;
4-
use pyo3::{PyAny, AsPyRef, PyErr, PyResult, Python, ToPyObject};
3+
use pyo3::{AsPyRef, PyAny, PyErr, PyResult, Python, ToPyObject};
4+
use quote::{quote, quote_spanned};
55

66
/// Format a nice error message for a python compilation error.
77
pub fn compile_error_msg(py: Python, error: PyErr, tokens: TokenStream) -> TokenStream {
88
let value = error.to_object(py);
99

1010
if value.is_none(py) {
1111
let error = format!("python: {}", error.ptype.as_ref(py).name());
12-
return quote!(compile_error!{#error});
12+
return quote!(compile_error! {#error});
1313
}
1414

1515
if error.matches(py, pyo3::exceptions::SyntaxError::type_object(py)) {
@@ -37,7 +37,7 @@ pub fn compile_error_msg(py: Python, error: PyErr, tokens: TokenStream) -> Token
3737
}
3838

3939
let error = format!("python: {}", value.as_ref(py).str().unwrap());
40-
quote!(compile_error!{#error})
40+
quote!(compile_error! {#error})
4141
}
4242

4343
fn get_traceback_info(tb: &PyAny) -> PyResult<(String, usize)> {

macros/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ fn python_impl(input: TokenStream) -> Result<TokenStream, TokenStream> {
4040

4141
Literal::byte_string(
4242
PyBytes::from_owned_ptr_or_err(py, ffi::PyMarshal_WriteObjectToString(code.as_ptr(), pyo3::marshal::VERSION))
43-
.map_err(|_e| quote!(compile_error!{"failed to generate python bytecode"}))?
43+
.map_err(|_e| quote!(compile_error! {"failed to generate python bytecode"}))?
4444
.as_bytes(),
4545
)
4646
};
@@ -96,7 +96,7 @@ fn check_no_attribute(input: TokenStream) -> Result<(), TokenStream> {
9696
&& input.next().map_or(false, |t| t.to_string() == "!")
9797
&& input.next().map_or(false, |t| t.to_string().starts_with('['))
9898
{
99-
return Err(quote!(compile_error!{
99+
return Err(quote!(compile_error! {
100100
"Attributes in python!{} are no longer supported. \
101101
Use context.run(python!{..}) to use a context.",
102102
}));

0 commit comments

Comments
 (0)