Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: bump mlua from 0.9 to 0.10 #2249

Merged
merged 2 commits into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ local-encoding = { version = "0.2", optional = true }
localzone = { version = "0.3", features = ["auto_validation"] }
log = "0.4"
mimalloc = { version = "0.1", default-features = false, optional = true }
mlua = { version = "0.9", features = [
mlua = { version = "0.10", features = [
"luau",
"luau-jit",
"serialize",
Expand Down
30 changes: 10 additions & 20 deletions src/cmd/luau.rs
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ fn sequential_mode(
let main_bytecode = if debug_enabled {
Vec::new()
} else {
luau_compiler.compile(main_script)
luau_compiler.compile(main_script)?
};

let mut record = csv::StringRecord::new();
Expand Down Expand Up @@ -803,12 +803,7 @@ fn sequential_mode(
}

if cmd_map {
map_computedvalue(
computed_value.as_ref(),
&mut record,
flag_remap,
new_column_count,
)?;
map_computedvalue(&computed_value, &mut record, flag_remap, new_column_count)?;

// check if the script is trying to insert a record with
// qsv_insertrecord(). We do this by checking if the global
Expand Down Expand Up @@ -895,7 +890,7 @@ fn sequential_mode(
beginend_insertrecord(luau, &mut insertrecord, headers_count, &mut wtr)?;

let end_string = match end_value {
Value::String(string) => string.to_string_lossy().to_string(),
Value::String(string) => string.to_string_lossy(),
Value::Number(number) => number.to_string(),
Value::Integer(number) => number.to_string(),
Value::Boolean(boolean) => (if boolean { "true" } else { "false" }).to_string(),
Expand Down Expand Up @@ -1029,7 +1024,7 @@ fn random_access_mode(

// in random access mode, setting "_INDEX" allows us to change the current record
// for the NEXT read
let mut pos = globals.get::<_, isize>(QSV_V_INDEX).unwrap_or_default();
let mut pos = globals.get::<isize>(QSV_V_INDEX).unwrap_or_default();
let mut curr_record = if pos > 0 && pos <= row_count as isize {
pos as u64
} else {
Expand All @@ -1041,7 +1036,7 @@ fn random_access_mode(
let main_bytecode = if debug_enabled {
Vec::new()
} else {
luau_compiler.compile(main_script)
luau_compiler.compile(main_script)?
};
let mut record = csv::StringRecord::new();
let mut error_count = 0_usize;
Expand Down Expand Up @@ -1153,12 +1148,7 @@ fn random_access_mode(
}

if cmd_map {
map_computedvalue(
computed_value.as_ref(),
&mut record,
flag_remap,
new_column_count,
)?;
map_computedvalue(&computed_value, &mut record, flag_remap, new_column_count)?;

// check if the MAIN script is trying to insert a record
match luau.globals().raw_get(QSV_INSERTRECORD_TBL) {
Expand Down Expand Up @@ -1209,7 +1199,7 @@ fn random_access_mode(
}
}

pos = globals.get::<_, isize>(QSV_V_INDEX).unwrap_or_default();
pos = globals.get::<isize>(QSV_V_INDEX).unwrap_or_default();
if pos < 0 || pos as u64 > row_count {
break 'main;
}
Expand Down Expand Up @@ -1244,7 +1234,7 @@ fn random_access_mode(
beginend_insertrecord(luau, &mut insertrecord, headers_count, &mut wtr)?;

let end_string = match end_value {
Value::String(string) => string.to_string_lossy().to_string(),
Value::String(string) => string.to_string_lossy(),
Value::Number(number) => number.to_string(),
Value::Integer(number) => number.to_string(),
Value::Boolean(boolean) => (if boolean { "true" } else { "false" }).to_string(),
Expand Down Expand Up @@ -1287,7 +1277,7 @@ fn map_computedvalue(
) -> Result<(), CliError> {
match computed_value {
Value::String(string) => {
if let Ok(utf8) = simdutf8::basic::from_utf8(string.as_bytes()) {
if let Ok(utf8) = simdutf8::basic::from_utf8(&string.as_bytes()) {
record.push_field(utf8);
} else {
record.push_field(&string.to_string_lossy());
Expand Down Expand Up @@ -1897,7 +1887,7 @@ fn setup_helpers(
let qsv_binary = env::current_exe().unwrap();

let mut cmd = std::process::Command::new(qsv_binary);
let qsv_args = args.to_str().unwrap_or_default().to_string();
let qsv_args = args.to_string_lossy();
let args_vec: Vec<&str> = qsv_args.split_whitespace().collect();
log::info!("Invoking qsv_cmd: {qsv_args}");
let result = cmd.args(args_vec).output();
Expand Down
2 changes: 1 addition & 1 deletion src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ pub fn version() -> String {
match luau.load("return _VERSION").eval() {
Ok(version_info) => {
if let mlua::Value::String(luaustring_val) = version_info {
let string_val = luaustring_val.to_str().unwrap_or("Luau - invalid version");
let string_val = luaustring_val.to_string_lossy();
if string_val == "Luau" {
enabled_features.push_str("Luau - version not specified;");
} else {
Expand Down
Loading