Skip to content

Commit c75529d

Browse files
committed
error: hide struct Error into error module
That matches code convention in `serde-json` crate: https://docs.rs/serde_json/latest/serde_json/index.html which does not expose error::Error type into crate root. Signed-off-by: Zhouqi Jiang <luojia@hust.edu.cn>
1 parent 683973a commit c75529d

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

examples/qemu-virt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use serde_derive::Deserialize;
1212
// - `StrSeq`: '\0' 分隔的一组字符串,设备树中一种常见的属性类型,这个类型要求可变的内存。
1313
use serde_device_tree::{
1414
buildin::{NodeSeq, Reg, StrSeq},
15-
from_raw_mut, Dtb, DtbPtr, Error,
15+
from_raw_mut, Dtb, DtbPtr, error::Error,
1616
};
1717

1818
fn main() -> Result<(), Error> {

src/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::Error;
1+
use crate::error::Error;
22

33
#[derive(Debug, Clone)]
44
#[repr(C)]

src/de_mut/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Deserialize device tree data to a Rust data structure,
22
//! the memory region contains dtb file should be mutable.
33
4-
use crate::Error as DtError;
4+
use crate::error::Error as DtError;
55
use serde::de;
66

77
mod cursor;

src/de_mut/structs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::{
22
common::{Header, ALIGN},
3-
Error as DtError,
3+
error::Error as DtError,
44
};
55
use core::{cell::RefCell, fmt::Display};
66

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ pub use de::from_raw;
3131
pub use de_mut::{buildin, from_raw_mut, Dtb, DtbPtr};
3232

3333
#[doc(inline)]
34-
pub use error::{Error, Result};
34+
pub use error::Result;

0 commit comments

Comments
 (0)