Skip to content
This repository has been archived by the owner on Mar 7, 2021. It is now read-only.

Commit

Permalink
json-sysctl: Oops, no need for pub mod error
Browse files Browse the repository at this point in the history
  • Loading branch information
geofft committed Aug 25, 2019
1 parent 8f72275 commit 66e2977
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ mod allocator;
pub mod bindings;
mod c_types;
pub mod chrdev;
pub mod error;
mod error;
pub mod filesystem;
pub mod printk;
pub mod sysctl;
Expand Down
5 changes: 2 additions & 3 deletions tests/json-sysctl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use core::sync::atomic::{AtomicBool, Ordering};
use serde::Serialize;
use serde_json_core;

use linux_kernel_module::error;
use linux_kernel_module::sysctl::Sysctl;
use linux_kernel_module::Mode;

Expand Down Expand Up @@ -37,8 +36,8 @@ impl linux_kernel_module::chrdev::FileOperations for JsonChrdev {
c: C.load(Ordering::Relaxed),
};
let mut s =
serde_json_core::to_vec::<typenum::U32, _>(&o).map_err(|_| error::Error::ENOMEM)?;
s.push(b'\n').map_err(|_| error::Error::ENOMEM)?;
serde_json_core::to_vec::<typenum::U32, _>(&o).map_err(|_| linux_kernel_module::Error::ENOMEM)?;
s.push(b'\n').map_err(|_| linux_kernel_module::Error::ENOMEM)?;
let start = min(offset.try_into()?, s.len());
let end = min(start + buf.len(), s.len());
buf.write(&s[start..end])?;
Expand Down

0 comments on commit 66e2977

Please sign in to comment.