Skip to content

Commit

Permalink
Clean up imports
Browse files Browse the repository at this point in the history
  • Loading branch information
jopemachine committed Jan 3, 2024
1 parent d254de3 commit 9875dfb
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 21 deletions.
3 changes: 0 additions & 3 deletions binding/python/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ install-release:
clean:
cargo clean

test:
python -m pytest

fmt:
cargo fmt

Expand Down
5 changes: 2 additions & 3 deletions binding/python/src/bindings/deserializer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ use std::sync::Mutex;

use once_cell::sync::Lazy;
use prost::Message as PMessage;
use pyo3::prelude::*;
use pyo3::{types::PyBytes, PyObject, Python};
use raftify::raft::derializer::{format_confchange, format_confchangev2};
use pyo3::{prelude::*, types::PyBytes, PyObject, Python};
use raftify::raft::{
derializer::{Bytes, CustomDeserializer},
eraftpb::{ConfChange, ConfChangeV2},
derializer::{format_confchange, format_confchangev2},
};

pub struct PythonDeserializer;
Expand Down
2 changes: 1 addition & 1 deletion binding/python/src/bindings/peers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::{collections::HashMap, hash::BuildHasherDefault};
use super::utils::new_py_list;

#[derive(Clone)]
#[pyclass(name = "Peers")]
#[pyclass(dict, name = "Peers")]
pub struct PyPeers {
pub inner: Peers,
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use pyo3::prelude::*;
use pyo3::types::PyDict;
use pyo3::{prelude::*, types::PyDict};
use raftify::raft::eraftpb::ConfChangeSingle;

use super::conf_change_type::PyConfChangeType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use pyo3::{exceptions::PyException, prelude::*, pyclass::CompareOp};
use raftify::raft::eraftpb::ConfChangeType;

#[derive(Clone)]
#[pyclass(name = "ConfChangeType")]
#[pyclass(frozen, name = "ConfChangeType")]
pub struct PyConfChangeType(pub ConfChangeType);

impl From<PyConfChangeType> for ConfChangeType {
Expand Down
5 changes: 2 additions & 3 deletions binding/python/src/bindings/raft_rs/eraftpb/conf_change_v2.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
use pyo3::types::PyDict;
use pyo3::{
prelude::*,
types::{PyBytes, PyList},
types::PyDict,
};
use raftify::raft::derializer::format_confchangev2;
use raftify::raft::eraftpb::ConfChangeV2;
use raftify::raft::{derializer::format_confchangev2, eraftpb::ConfChangeV2};

use super::{
conf_change_single::PyConfChangeSingle, conf_change_transition::PyConfChangeTransition,
Expand Down
6 changes: 2 additions & 4 deletions binding/python/src/bindings/raft_rs/eraftpb/entry.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use pyo3::prelude::*;
use pyo3::types::{PyBytes, PyDict};
use raftify::raft::derializer::format_entry;
use raftify::raft::eraftpb::Entry;
use pyo3::{prelude::*, types::{PyBytes, PyDict}};
use raftify::raft::{derializer::format_entry, eraftpb::Entry};

use super::entry_type::PyEntryType;

Expand Down
2 changes: 1 addition & 1 deletion binding/python/src/bindings/raft_rs/eraftpb/entry_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use pyo3::{exceptions::PyRuntimeError, prelude::*, pyclass::CompareOp};
use raftify::raft::eraftpb::EntryType;

#[derive(Clone)]
#[pyclass(name = "EntryType")]
#[pyclass(frozen, name = "EntryType")]
pub struct PyEntryType(pub EntryType);

impl From<PyEntryType> for EntryType {
Expand Down
3 changes: 1 addition & 2 deletions binding/python/src/bindings/raft_rs/eraftpb/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ use pyo3::{
prelude::*,
types::{PyBytes, PyList},
};
use raftify::raft::derializer::format_message;
use raftify::raft::eraftpb::Message;
use raftify::raft::{derializer::format_message, eraftpb::Message};

use super::{entry::PyEntry, message_type::PyMessageType};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use pyo3::{exceptions::PyRuntimeError, prelude::*, pyclass::CompareOp};
use raftify::raft::eraftpb::MessageType;

#[derive(Clone)]
#[pyclass(name = "MessageType")]
#[pyclass(frozen, name = "MessageType")]
pub struct PyMessageType(pub MessageType);

impl From<PyMessageType> for MessageType {
Expand Down

0 comments on commit 9875dfb

Please sign in to comment.