Skip to content

Commit

Permalink
nannou_osc: update rosc from 0.1 to 0.10
Browse files Browse the repository at this point in the history
Also re-export new types.
  • Loading branch information
mitchmindtree committed Jan 17, 2024
1 parent 4500106 commit 74d4267
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion nannou_osc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ homepage = "https://nannou.cc"
edition = "2018"

[dependencies]
rosc = "0.1"
rosc = "0.10"
8 changes: 4 additions & 4 deletions nannou_osc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ pub use rosc;
pub use self::recv::Receiver;
#[doc(inline)]
pub use self::rosc::{
decoder, encoder, OscBundle as Bundle, OscColor as Color, OscError as Error,
OscMessage as Message, OscMidiMessage as MidiMessage, OscType as Type,
address, decoder, encoder, OscArray as Array, OscBundle as Bundle, OscColor as Color,
OscError as Error, OscMessage as Message, OscMidiMessage as MidiMessage, OscTime as Time,
OscTimeError as TimeError, OscType as Type,
};
pub use self::send::Sender;

Expand Down Expand Up @@ -121,15 +122,14 @@ where
A: Into<String>,
{
let addr = addr.into();
let args = Some(args);
Message { addr, args }
}

/// Decodes the given slice of `bytes` into a `Packet`.
///
/// Returns an `Error` if the slice does not contain a valid OSC packet.
pub fn decode(bytes: &[u8]) -> Result<Packet, Error> {
rosc::decoder::decode(bytes).map(|p| p.into())
rosc::decoder::decode_udp(bytes).map(|(_bytes, p)| p.into())
}

/// Encodes the given `Packet` into a `Vec` of bytes.
Expand Down

0 comments on commit 74d4267

Please sign in to comment.