Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Lint Definitions to Cargo.toml #5

Merged
merged 3 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,17 @@ anyhow = "1"
bytes = "1"
colored = "2"
mockall = { version = "0.12", features = ["nightly"] }

[lints.rust]
warnings = "deny"

[lints.clippy]
pedantic = { level = "deny", priority = -1 }
nursery = { level = "deny", priority = -1 }
undocumented_unsafe_blocks = "deny"
arithmetic_side_effects = "deny"

[lints.rustdoc]
all = "warn"
missing_doc_code_examples = "warn"

2 changes: 1 addition & 1 deletion clippy.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
doc-valid-idents = ["VersaTest"]
doc-valid-idents = ["VersaTest"]
20 changes: 10 additions & 10 deletions src/interface/async_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,19 @@ impl AsyncStream {
}

fn drop_write_channel(&mut self) -> Result<()> {
match self.write_to.take() {
Some(send) => {
match send.send(AsyncMessage::End) {
Ok(()) => {}
Err(_) => {
return Err(InstrumentError::IoError { source: (std::io::Error::new(
if let Some(send) = self.write_to.take() {
match send.send(AsyncMessage::End) {
Ok(()) => {}
Err(_) => {
return Err(InstrumentError::IoError {
source: (std::io::Error::new(
ErrorKind::NotConnected,
"attempted to write asynchronously to socket, but it was not connected".to_string(),
))});
}
"attempted to write asynchronously to socket, but it was not connected"
.to_string(),
)),
});
}
}
None => {}
}
Ok(())
}
Expand Down
9 changes: 0 additions & 9 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
#![feature(lint_reasons, rustdoc_missing_doc_code_examples)]
#![deny(
clippy::undocumented_unsafe_blocks,
clippy::pedantic,
clippy::nursery,
clippy::arithmetic_side_effects
)]
#![feature(assert_matches)]
//#![warn(missing_docs, rustdoc::all)]
//#![allow(rustdoc::missing_doc_code_examples)]
#![doc(html_logo_url = "../../../ki-comms_doc_icon.png")]

//! The TSP Instrument crate defines the necessary components to enable communication
Expand All @@ -25,7 +17,6 @@ pub mod model;
#[cfg(test)]
pub(crate) mod test_util;

//pub use connect::{AsyncToSync, Connect, ConnectAsync, ConnectionAddr, Disconnect};
pub use error::InstrumentError;
pub use instrument::firmware::Flash;
pub use interface::{connection_addr::ConnectionAddr, usbtmc, Interface};
Expand Down
Loading