Skip to content
This repository was archived by the owner on Oct 21, 2023. It is now read-only.

Commit a0a62be

Browse files
author
LaoLittle
committed
update
1 parent 1e92d1b commit a0a62be

File tree

2 files changed

+6
-41
lines changed

2 files changed

+6
-41
lines changed

src/config/mod.rs

+5-39
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,16 @@
1-
use std::path::{Path, PathBuf};
1+
use std::path::Path;
22

3+
pub mod log;
34
pub mod login;
45
pub mod plugin;
5-
6-
const SERVICE_CONFIG_PATH: &str = "service";
6+
pub mod service;
77

88
pub fn service_config_dir_path() -> &'static Path {
9+
static SERVICE_CONFIG_PATH: &str = "service";
910
Path::new(SERVICE_CONFIG_PATH)
1011
}
1112

12-
const CLIENTS_PATH: &str = "clients";
13-
1413
pub fn clients_dir_path() -> &'static Path {
14+
static CLIENTS_PATH: &str = "clients";
1515
Path::new(CLIENTS_PATH)
1616
}
17-
18-
pub struct Config {
19-
file: PathBuf,
20-
}
21-
22-
#[derive(Default)]
23-
pub struct ConfigBuilder<'a> {
24-
root: PathBuf,
25-
file: Option<&'a str>,
26-
}
27-
28-
impl<'a> ConfigBuilder<'a> {
29-
pub fn new() -> Self {
30-
Self::default()
31-
}
32-
33-
pub fn with_root<P: Into<PathBuf>>(mut self, root: P) -> Self {
34-
self.root = root.into();
35-
self
36-
}
37-
38-
pub fn with_file(mut self, name: &'a str) -> Self {
39-
self.file = Some(name);
40-
self
41-
}
42-
43-
pub fn build(self) -> Option<Config> {
44-
let mut path = self.root;
45-
46-
path.push(self.file?);
47-
48-
Some(Config { file: path })
49-
}
50-
}

src/plugin/ffi/rt.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ use super::cast_ref;
22
use crate::service::plugin::PluginManager;
33
use atri_ffi::error::FFIResult;
44
use atri_ffi::future::FFIFuture;
5-
use atri_ffi::{Managed, RustString};
6-
use std::ffi::{c_char, CStr};
5+
use atri_ffi::Managed;
76
use std::future::Future;
87

98
pub extern "C" fn plugin_manager_spawn(

0 commit comments

Comments
 (0)