Verified Commit f5cbcc6a authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Fix for compilation with stable rust

parent dbfc5cdb
#![no_std] #![no_std]
#![feature(min_const_generics)]
extern crate alloc; extern crate alloc;
use core::mem; use core::mem;
...@@ -34,7 +33,7 @@ impl Mode { ...@@ -34,7 +33,7 @@ impl Mode {
pub fn kind(self) -> Mode { pub fn kind(self) -> Mode {
self & Mode::KIND self & Mode::KIND
} }
/// Only any permissions bits /// Only any permissions bits
pub fn perm(self) -> Mode { pub fn perm(self) -> Mode {
self & Mode::PERM self & Mode::PERM
...@@ -59,4 +58,3 @@ mod tests { ...@@ -59,4 +58,3 @@ mod tests {
assert_eq!(ENTRY_SIZE, 308); assert_eq!(ENTRY_SIZE, 308);
} }
} }
...@@ -146,7 +146,7 @@ pub fn create( ...@@ -146,7 +146,7 @@ pub fn create(
.read(true) .read(true)
.open(&path) .open(&path)
.chain_err(|| &path )?; .chain_err(|| &path )?;
copy_and_hash(&mut entry_file, &mut archive_file, &mut buf) copy_and_hash(&mut entry_file, &mut archive_file, &mut buf)
.chain_err(|| &path ) .chain_err(|| &path )
.chain_err(|| format!("Writing entry to archive: '{}'", relative.display()) )? .chain_err(|| format!("Writing entry to archive: '{}'", relative.display()) )?
...@@ -179,7 +179,7 @@ pub fn create( ...@@ -179,7 +179,7 @@ pub fn create(
//TODO: ensure file size matches //TODO: ensure file size matches
header.signature = sign::sign_detached(unsafe { &plain::as_bytes(&header)[64..] }, &secret_key).0; header.signature = sign::sign_detached(unsafe { &plain::as_bytes(&header)[64..] }, &secret_key).to_bytes();
// Write archive header // Write archive header
archive_file.seek(SeekFrom::Start(0)) archive_file.seek(SeekFrom::Start(0))
...@@ -271,4 +271,3 @@ pub fn verify( ...@@ -271,4 +271,3 @@ pub fn verify(
} }
Ok(()) Ok(())
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment