Skip to content

Commit

Permalink
Fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
roblabla committed Sep 17, 2019
1 parent b0ad410 commit 06f20e2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
1 change: 0 additions & 1 deletion libkern/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ extern crate lazy_static;
pub mod error;

use core::fmt;
use bitfield::bitfield;
use static_assertions::assert_eq_size;
use core::mem::size_of;

Expand Down
16 changes: 9 additions & 7 deletions libuser/src/caps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,18 @@
//!
//! ```
//! extern crate sunrise_libuser;
//! use sunrise_libuser::{syscalls, caps, capabilities};
//! kip_header!(HEADER = KipHeader {
//! use sunrise_libuser::{syscalls, caps, capabilities, kip_header};
//! use sunrise_libuser::caps::ProcessCategory;
//! kip_header!(HEADER = caps::KipHeader {
//! magic: *b"KIP1",
//! name: *b"test\0\0\0\0\0\0\0\0",
//! title_id: 0x0200000000001000,
//! category: 1,
//! process_category: ProcessCategory::KernelBuiltin,
//! main_thread_priority: 0,
//! default_cpu_core: 0,
//! reserved: 0,
//! flags: 0,
//! stack_page_count: 16,
//! ..default::Default()
//! });
//!
//! capabilities!(CAPABILITIES = Capabilities {
Expand Down Expand Up @@ -139,12 +140,13 @@ pub use sunrise_libkern::process::{KipHeader, ProcessCategory};
///
/// ```no_run
/// extern crate sunrise_libuser;
/// use sunrise_libuser::{syscalls, caps, capabilities};
/// capabilities!(HEADER = KipHeader {
/// use sunrise_libuser::{caps, kip_header};
/// use sunrise_libuser::caps::ProcessCategory;
/// kip_header!(HEADER = caps::KipHeader {
/// magic: *b"KIP1",
/// name: *b"test\0\0\0\0\0\0\0\0",
/// title_id: 0x0200000000001000,
/// category: 1,
/// process_category: ProcessCategory::KernelBuiltin,
/// main_thread_priority: 0,
/// default_cpu_core: 0,
/// flags: 0,
Expand Down
1 change: 1 addition & 0 deletions loader/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ fn boot(fs: &IFileSystemProxy, titleid: u64) -> Result<(), Error> {
Ok(())
}

/// Turn the given UTF-8 titleid into an u64 titleid.
fn get_titleid_from_path(titleid: &[u8]) -> Result<u64, Error> {
let titleid = str::from_utf8(titleid).or(Err(LoaderError::InvalidPath))?;
let titleid = u64::from_str_radix(titleid, 16).or(Err(LoaderError::InvalidPath))?;
Expand Down

0 comments on commit 06f20e2

Please sign in to comment.