Skip to content

Commit

Permalink
Allow large err results
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelbuesing committed Feb 8, 2024
1 parent 3caaae5 commit 41b3f54
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -654,13 +654,15 @@ pub struct DBC {

impl DBC {
/// Read a DBC from a buffer
#[allow(clippy::result_large_err)]
pub fn from_slice(buffer: &[u8]) -> Result<DBC, Error> {
let dbc_in = std::str::from_utf8(buffer).unwrap();
Self::try_from(dbc_in)
}

#[allow(clippy::should_implement_trait)]
#[deprecated(since = "4.0.0", note = "please use `DBC::try_from` instead")]
#[allow(clippy::result_large_err)]
pub fn from_str(dbc_in: &str) -> Result<DBC, Error> {
let (remaining, dbc) = parser::dbc(dbc_in).map_err(Error::Nom)?;
if !remaining.is_empty() {
Expand Down Expand Up @@ -775,6 +777,7 @@ impl DBC {

/// Lookup the message multiplexor switch signal for a given message
/// This does not work for extended multiplexed messages, if multiple multiplexors are defined for a message a Error is returned.
#[allow(clippy::result_large_err)]
pub fn message_multiplexor_switch(
&self,
message_id: MessageId,
Expand Down

0 comments on commit 41b3f54

Please # to comment.