Skip to content

Commit

Permalink
style: 代码格式化
Browse files Browse the repository at this point in the history
  • Loading branch information
enpitsuLin committed Aug 3, 2022
1 parent 8facbbd commit 5c566ab
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 34 deletions.
17 changes: 4 additions & 13 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,13 @@ fn main() {

work_dir.iter().for_each(|dir_path| {
let asset_path = Path::new(&lib_dir).join("*.dll");
let exe_dir = &Path::new(&out_dir[..])
.join(dir_path)
.canonicalize()
.unwrap();
let exe_dir = &Path::new(&out_dir[..]).join(dir_path).canonicalize().unwrap();
symbolic_link_assets(asset_path.to_str().unwrap(), exe_dir).unwrap();
});
}

#[cfg(windows)]
fn symbolic_link_assets(
asset_dir: &str,
exe_dir: &PathBuf,
) -> Result<(), Box<dyn std::error::Error>> {
fn symbolic_link_assets(asset_dir: &str, exe_dir: &PathBuf) -> Result<(), Box<dyn std::error::Error>> {
for asset in glob::glob(asset_dir).unwrap() {
match asset {
Ok(dll_origin) => {
Expand All @@ -46,17 +40,14 @@ fn symbolic_link_assets(
}
os::windows::fs::symlink_file(dll_origin, dll_symbol)?;
};
}
},
Err(_) => unreachable!(),
}
}
Ok(())
}

#[cfg(not(windows))]
fn symbolic_link_assets(
asset_dir: &str,
exe_dir: &PathBuf,
) -> Result<(), Box<dyn std::error::Error>> {
fn symbolic_link_assets(asset_dir: &str, exe_dir: &PathBuf) -> Result<(), Box<dyn std::error::Error>> {
unimplemented!()
}
2 changes: 1 addition & 1 deletion src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub enum AsstMsg {

impl TryFrom<i32> for AsstMsg {
type Error = ();

fn try_from(input: i32) -> Result<Self, Self::Error> {
let input = input.to_owned();
match input {
Expand Down
24 changes: 4 additions & 20 deletions src/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,14 @@ extern "C" {
address: *const c_char,
config: *const c_char,
) -> bool;
pub fn AsstAppendTask(
handle: AsstHandle,
type_: *const c_char,
params: *const c_char,
) -> TaskId;
pub fn AsstAppendTask(handle: AsstHandle, type_: *const c_char, params: *const c_char) -> TaskId;
pub fn AsstSetTaskParams(handle: AsstHandle, id: TaskId, params: *const c_char) -> bool;
pub fn AsstStart(handle: AsstHandle) -> bool;
pub fn AsstStop(handle: AsstHandle) -> bool;
pub fn AsstCtrlerClick(handle: AsstHandle, x: c_int, y: c_int, block: bool) -> bool;
pub fn AsstGetImage(
handle: AsstHandle,
buff: *mut c_void,
buff_size: c_ulonglong,
) -> c_ulonglong;
pub fn AsstGetUUID(
handle: AsstHandle,
buff: *const c_char,
buff_size: c_ulonglong,
) -> c_ulonglong;
pub fn AsstGetTasksList(
handle: AsstHandle,
buff: *const TaskId,
buff_size: c_ulonglong,
) -> c_ulonglong;
pub fn AsstGetImage(handle: AsstHandle, buff: *mut c_void, buff_size: c_ulonglong) -> c_ulonglong;
pub fn AsstGetUUID(handle: AsstHandle, buff: *const c_char, buff_size: c_ulonglong) -> c_ulonglong;
pub fn AsstGetTasksList(handle: AsstHandle, buff: *const TaskId, buff_size: c_ulonglong) -> c_ulonglong;
pub fn AsstGetVersion() -> *const c_char;
pub fn AsstGetNullSize() -> c_ulonglong;
pub fn AsstLog(level: *const c_char, message: *const c_char);
Expand Down

0 comments on commit 5c566ab

Please sign in to comment.