rust: Create a root file for modules
The new `lib.rs` file is created to refer to all modules written in Rust. This way, only one `rustc` call is needed to compile an arbitrary amount of modules. It also converges with the way crates are structured.
This commit is contained in:
@ -1,11 +1,10 @@
|
||||
#[macro_use]
|
||||
mod bitflags;
|
||||
|
||||
use std::boxed::Box;
|
||||
use std::ffi::CString;
|
||||
use std::num::Wrapping;
|
||||
use std::string::String;
|
||||
|
||||
use super::bitflags;
|
||||
|
||||
/// Gathers stuff defined in C or called by C
|
||||
pub mod c {
|
||||
use super::*;
|
||||
@ -221,7 +220,7 @@ pub enum ContentPurpose {
|
||||
|
||||
impl ContentPurpose {
|
||||
fn from_num(num: u32) -> Option<ContentPurpose> {
|
||||
use ContentPurpose::*;
|
||||
use self::ContentPurpose::*;
|
||||
match num {
|
||||
0 => Some(Normal),
|
||||
1 => Some(Alpha),
|
||||
@ -241,7 +240,7 @@ impl ContentPurpose {
|
||||
}
|
||||
}
|
||||
fn as_num(self: &ContentPurpose) -> u32 {
|
||||
use ContentPurpose::*;
|
||||
use self::ContentPurpose::*;
|
||||
match self {
|
||||
Normal => 0,
|
||||
Alpha => 1,
|
||||
|
||||
3
src/lib.rs
Normal file
3
src/lib.rs
Normal file
@ -0,0 +1,3 @@
|
||||
#[macro_use]
|
||||
mod bitflags;
|
||||
mod imservice;
|
||||
@ -69,7 +69,7 @@ deps = [
|
||||
# Replacement for eekboard-server
|
||||
rslib = static_library(
|
||||
'rslib',
|
||||
sources: ['imservice.rs'],
|
||||
sources: ['lib.rs'],
|
||||
rust_crate_type: 'staticlib'
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user