Try fixing cargo fmt on travis ci

This commit is contained in:
konstin 2019-03-24 17:19:15 +01:00
parent f75f742c58
commit 97189a16b9
9 changed files with 9 additions and 10 deletions

View file

@ -6,7 +6,7 @@ set -e
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain=$TRAVIS_RUST_VERSION
export PATH=$PATH:$HOME/.cargo/bin
if [ $TRAVIS_JOB_NAME = 'Minimum nightly' ]; then
if [ "$TRAVIS_JOB_NAME" = "Minimum nightly" ]; then
rustup component add clippy
rustup component add rustfmt
fi

View file

@ -4,7 +4,7 @@ set -ex
cargo clean
cargo test --features "$FEATURES num-complex"
( cd pyo3-derive-backend; cargo test )
if [ $TRAVIS_JOB_NAME = 'Minimum nightly' ]; then
if [ "$TRAVIS_JOB_NAME" = "Minimum nightly" ]; then
cargo fmt --all -- --check
cargo clippy --features "$FEATURES num-complex"
fi

View file

@ -379,7 +379,7 @@ pub mod socket {
mod test {
use crate::exceptions::Exception;
use crate::objectprotocol::ObjectProtocol;
use crate::types::{PyDict, IntoPyDict};
use crate::types::{IntoPyDict, PyDict};
use crate::{PyErr, Python};
import_exception!(socket, gaierror);

View file

@ -390,7 +390,7 @@ impl<'p> Python<'p> {
#[cfg(test)]
mod test {
use crate::objectprotocol::ObjectProtocol;
use crate::types::{PyAny, PyBool, IntoPyDict, PyInt, PyList};
use crate::types::{IntoPyDict, PyAny, PyBool, PyInt, PyList};
use crate::Python;
#[test]

View file

@ -24,7 +24,6 @@ pub fn indoc(commands: &str) -> String {
#[macro_export]
macro_rules! py_run {
($py:expr, $val:expr, $code:expr) => {{
use pyo3::types::IntoPyDict;
let d = [(stringify!($val), &$val)].into_py_dict($py);
@ -51,7 +50,6 @@ macro_rules! py_assert {
#[macro_export]
macro_rules! py_expect_exception {
($py:expr, $val:ident, $code:expr, $err:ident) => {{
use pyo3::types::IntoPyDict;
let d = [(stringify!($val), &$val)].into_py_dict($py);

View file

@ -3,9 +3,9 @@ use pyo3::exceptions::BufferError;
use pyo3::ffi;
use pyo3::prelude::*;
use pyo3::types::IntoPyDict;
use std::ffi::CStr;
use std::os::raw::{c_int, c_void};
use std::ptr;
use std::ffi::CStr;
#[pyclass]
struct TestClass {

View file

@ -2,7 +2,7 @@
use pyo3::ffi::*;
use pyo3::prelude::*;
use pyo3::types::{PyAny, IntoPyDict};
use pyo3::types::{IntoPyDict, PyAny};
fn _get_subclasses<'p>(
py: &'p Python,

View file

@ -6,7 +6,7 @@ use pyo3::class::{
use pyo3::exceptions::{IndexError, ValueError};
use pyo3::ffi;
use pyo3::prelude::*;
use pyo3::types::{PyAny, PyBytes, IntoPyDict, PySlice, PyString, PyType};
use pyo3::types::{IntoPyDict, PyAny, PyBytes, PySlice, PyString, PyType};
use pyo3::AsPyPointer;
use std::{isize, iter};

View file

@ -61,7 +61,8 @@ fn test_module_with_functions() {
let d = [(
"module_with_functions",
wrap_pymodule!(module_with_functions)(py),
)].into_py_dict(py);
)]
.into_py_dict(py);
let run = |code| py.run(code, None, Some(d)).unwrap();