From f95c09fab246237528c725902ec7496250c32699 Mon Sep 17 00:00:00 2001 From: Kan-Ru Chen Date: Sun, 31 Dec 2023 23:50:07 +0900 Subject: [PATCH] refactor: reorganize modules with 2015 style --- src/{conversion.rs => conversion/mod.rs} | 4 ++-- src/{dictionary.rs => dictionary/mod.rs} | 0 src/editor/{keyboard.rs => keyboard/mod.rs} | 0 src/{editor.rs => editor/mod.rs} | 2 +- src/editor/{syllable.rs => syllable/mod.rs} | 0 src/{zhuyin.rs => zhuyin/mod.rs} | 0 6 files changed, 3 insertions(+), 3 deletions(-) rename src/{conversion.rs => conversion/mod.rs} (95%) rename src/{dictionary.rs => dictionary/mod.rs} (100%) rename src/editor/{keyboard.rs => keyboard/mod.rs} (100%) rename src/{editor.rs => editor/mod.rs} (99%) rename src/editor/{syllable.rs => syllable/mod.rs} (100%) rename src/{zhuyin.rs => zhuyin/mod.rs} (100%) diff --git a/src/conversion.rs b/src/conversion/mod.rs similarity index 95% rename from src/conversion.rs rename to src/conversion/mod.rs index 5fa593214..7b8df9d32 100644 --- a/src/conversion.rs +++ b/src/conversion/mod.rs @@ -7,8 +7,8 @@ use std::cmp::{max, min}; use crate::zhuyin::Syllable; -pub use self::chewing::ChewingEngine; -pub(crate) use self::symbol::{full_width_symbol_input, special_symbol_input}; +pub use chewing::ChewingEngine; +pub(crate) use symbol::{full_width_symbol_input, special_symbol_input}; /// TODO: doc #[derive(Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash, Clone)] diff --git a/src/dictionary.rs b/src/dictionary/mod.rs similarity index 100% rename from src/dictionary.rs rename to src/dictionary/mod.rs diff --git a/src/editor/keyboard.rs b/src/editor/keyboard/mod.rs similarity index 100% rename from src/editor/keyboard.rs rename to src/editor/keyboard/mod.rs diff --git a/src/editor.rs b/src/editor/mod.rs similarity index 99% rename from src/editor.rs rename to src/editor/mod.rs index ae4ba6eef..a1d08e4a8 100644 --- a/src/editor.rs +++ b/src/editor/mod.rs @@ -968,7 +968,7 @@ impl Selecting { C: ConversionEngine>, { // FIXME load from data - let reader = io::Cursor::new(include_str!("../data/symbols.dat")); + let reader = io::Cursor::new(include_str!("../../data/symbols.dat")); let sel = SymbolSelector::new(reader).expect("parse symbols table"); Selecting { page_no: 0, diff --git a/src/editor/syllable.rs b/src/editor/syllable/mod.rs similarity index 100% rename from src/editor/syllable.rs rename to src/editor/syllable/mod.rs diff --git a/src/zhuyin.rs b/src/zhuyin/mod.rs similarity index 100% rename from src/zhuyin.rs rename to src/zhuyin/mod.rs