ksud: bump dependencies

This commit is contained in:
weishu
2023-11-02 12:05:21 +08:00
parent e9df5105b3
commit b4a52f89cc
4 changed files with 195 additions and 125 deletions

View File

@@ -344,7 +344,7 @@ fn _install_module(zip: &str) -> Result<()> {
zip_extract_file_to_memory(&zip_path, &entry_path, &mut buffer)?;
let mut module_prop = HashMap::new();
PropertiesIter::new_with_encoding(Cursor::new(buffer), encoding::all::UTF_8).read_into(
PropertiesIter::new_with_encoding(Cursor::new(buffer), encoding_rs::UTF_8).read_into(
|k, v| {
module_prop.insert(k, v);
},
@@ -558,12 +558,13 @@ pub fn uninstall_module(id: &str) -> Result<()> {
}
let content = std::fs::read(module_prop)?;
let mut module_id: String = String::new();
PropertiesIter::new_with_encoding(Cursor::new(content), encoding::all::UTF_8)
.read_into(|k, v| {
PropertiesIter::new_with_encoding(Cursor::new(content), encoding_rs::UTF_8).read_into(
|k, v| {
if k.eq("id") {
module_id = v;
}
})?;
},
)?;
if module_id.eq(mid) {
let remove_file = path.join(defs::REMOVE_FILE_NAME);
File::create(remove_file).with_context(|| "Failed to create remove file.")?;
@@ -656,7 +657,7 @@ fn _list_modules(path: &str) -> Vec<HashMap<String, String>> {
continue;
};
let mut module_prop_map: HashMap<String, String> = HashMap::new();
let encoding = encoding::all::UTF_8;
let encoding = encoding_rs::UTF_8;
let result =
PropertiesIter::new_with_encoding(Cursor::new(content), encoding).read_into(|k, v| {
module_prop_map.insert(k, v);

View File

@@ -230,6 +230,7 @@ pub fn mount_overlay(root: &String, module_roots: &Vec<String>) -> Result<()> {
.mountinfo()
.with_context(|| "get mountinfo")?;
let mut mount_seq = mounts
.0
.iter()
.filter(|m| {
m.mount_point.starts_with(root) && !Path::new(&root).starts_with(&m.mount_point)