Skip to content

Commit

Permalink
Make it compile again
Browse files Browse the repository at this point in the history
  • Loading branch information
SonnyX committed Oct 7, 2022
1 parent 39d4eaf commit 83acc4e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,30 @@ build = "build.rs"
include = ["src/**/*", "Cargo.toml"]

[dependencies]
tokio = { version = "1.12", features = ["full"] }
url = "2.2"
tokio = { version = "1.21.2", features = ["full"] }
url = "2.3.1"
sciter-rs = "0.5"
renegadex_patcher = { git = "https://github.com/SonnyX/RenegadeX-patcher-lib" }
rust-ini = "0.18"
single-instance = "0.3"
socket2 = { version="0.4", features=["all"]}
rand = "0.8"
percent-encoding = "2.1"
percent-encoding = "2.2.0"
unzip = { git = "https://github.com/SonnyX/unzip-rs" }
dirs = "4.0"
runas = { git = "https://github.com/SonnyX/rust-runas" }
sha2 = "0.10"
hex = "0.4"
log = "0.4"
flexi_logger = "0.23"
flexi_logger = "0.24"
download-async = "0.10"
async-trait = "0.1"
json = "0.12"
quick-xml = { version="0.25", features=["serialize"] }
semver = "1.0.11"
quick-xml = { version="0.25" }
semver = "1.0.14"

[build-dependencies]
embed-resource = "1.6"
embed-resource = "1.7.3"

[profile.release]
opt-level = 'z'
Expand Down
14 changes: 7 additions & 7 deletions backend/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -660,19 +660,19 @@ impl Handler {
input = input.replace("\n","\\n").replace("\r","\\r");
let mut reader = Reader::from_str(&input);
let mut json = format!("");
let mut buf = Vec::new();
//let mut buf = Vec::new();
let mut add_comma = false;
loop {
match reader.read_event(&mut buf) {
match reader.read_event() {
Ok(event) => {
match event {
Event::Start(ref e) => {
let comma = match add_comma {
true => ",".to_string(),
false => "".to_string()
};
let attrs = e.attributes().filter(|attr| attr.is_ok()).map(|result| result.unwrap()).map(|attr| format!("\"{}\": \"{}\"", &std::str::from_utf8(&attr.key).unwrap(), &std::str::from_utf8(&attr.value).unwrap())).collect::<Vec<String>>().join(",");
json = format!("{}{}[\"{}\", {{ {} }}, [", json, comma, &std::str::from_utf8(e.name())?, attrs);
let attrs = e.attributes().filter(|attr| attr.is_ok()).map(|result| result.unwrap()).map(|attr| format!("\"{}\": \"{}\"", &std::str::from_utf8(attr.key.as_ref()).unwrap(), &std::str::from_utf8(attr.value.as_ref()).unwrap())).collect::<Vec<String>>().join(",");
json = format!("{}{}[\"{}\", {{ {} }}, [", json, comma, &std::str::from_utf8(e.name().as_ref())?, attrs);
add_comma = false;
},
Event::End(ref _e) => {
Expand All @@ -689,7 +689,7 @@ impl Handler {
},
Event::Text(text) => {
if !json.is_empty() {
let text = &reader.decode(&text).unwrap();
let text = &reader.decoder().decode(&text).unwrap();
if !text.is_empty() {
let comma = match add_comma {
true => ",".to_string(),
Expand All @@ -705,8 +705,8 @@ impl Handler {
true => ",".to_string(),
false => "".to_string()
};
let attrs = e.attributes().filter(|attr| attr.is_ok()).map(|result| result.unwrap()).map(|attr| format!("\"{}\": \"{}\"", &std::str::from_utf8(&attr.key).unwrap(), &std::str::from_utf8(&attr.value).unwrap())).collect::<Vec<String>>().join(",");
json = format!("{}{}[\"{}\", {{ {} }}, []]", json, comma, &std::str::from_utf8(e.name())?, attrs);
let attrs = e.attributes().filter(|attr| attr.is_ok()).map(|result| result.unwrap()).map(|attr| format!("\"{}\": \"{}\"", &std::str::from_utf8(attr.key.as_ref()).unwrap(), &std::str::from_utf8(&attr.value).unwrap())).collect::<Vec<String>>().join(",");
json = format!("{}{}[\"{}\", {{ {} }}, []]", json, comma, &std::str::from_utf8(e.name().as_ref())?, attrs);
add_comma = true;
},
Event::Eof => {
Expand Down
Binary file modified sciter.dll
Binary file not shown.

0 comments on commit 83acc4e

Please sign in to comment.