Skip to content

Commit

Permalink
Merge branch 'main' of github.com:diba-io/carbonado
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptoquick committed Oct 27, 2023
2 parents ec947c5 + 5181885 commit dbc5b52
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ secp256k1 = { version = "0.27.0", features = [
serde = "1.0.164"
snap = "1.1.0"
thiserror = "1.0"

zfec-rs = "0.1.0"
once_cell = "=1.17.0"

[dev-dependencies]
anyhow = "1.0.71"
Expand Down
4 changes: 1 addition & 3 deletions src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ use bitmask_enum::bitmask;
use serde::{Deserialize, Serialize};

/// "Magic number" used by the Carbonado file format. 12 bytes: "CARBONADO", and a version, 00, plus a newline character
pub const MAGICNO: [u8; 12] = [
b'C', b'A', b'R', b'B', b'O', b'N', b'A', b'D', b'O', b'0', b'0', b'\n',
];
pub const MAGICNO: &[u8; 12] = b"CARBONADO00\n";

/// Bao slice length
pub const SLICE_LEN: u16 = 1024;
Expand Down
2 changes: 1 addition & 1 deletion src/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl TryFrom<&File> for Header {
handle.read_exact(&mut padding_len)?;
handle.read_exact(&mut metadata)?;

if magic_no != MAGICNO {
if &magic_no != MAGICNO {
return Err(CarbonadoError::InvalidMagicNumber(format!("{magic_no:#?}")));
}

Expand Down

0 comments on commit dbc5b52

Please sign in to comment.