Skip to content

Commit e299009

Browse files
committed
Migrate to Rust edition 2024 with 'cargo fix --edition'
1 parent 77dcfab commit e299009

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

rewatch/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "rewatch"
33
version = "12.0.0-alpha.15"
4-
edition = "2021"
4+
edition = "2024"
55

66
[dependencies]
77
ahash = "0.8.3"

rewatch/src/build/compile.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ fn compile_file(
603603
let ocaml_build_path_abs = package.get_ocaml_build_path();
604604
let build_path_abs = package.get_build_path();
605605
let implementation_file_path = match &module.source_type {
606-
SourceType::SourceFile(ref source_file) => Ok(&source_file.implementation.path),
606+
SourceType::SourceFile(source_file) => Ok(&source_file.implementation.path),
607607
sourcetype => Err(format!(
608608
"Tried to compile a file that is not a source file ({}). Path to AST: {}. ",
609609
sourcetype,

rewatch/src/build/deps.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ fn get_dep_modules(
1313
) -> AHashSet<String> {
1414
let mut deps = AHashSet::new();
1515
let ast_file = package.get_build_path().join(ast_file);
16-
if let Ok(lines) = helpers::read_lines(&ast_file) {
16+
match helpers::read_lines(&ast_file) { Ok(lines) => {
1717
// we skip the first line with is some null characters
1818
// the following lines in the AST are the dependency modules
1919
// we stop when we hit a line that starts with a "/", this is the path of the file.
@@ -26,9 +26,9 @@ fn get_dep_modules(
2626
deps.insert(line);
2727
}
2828
}
29-
} else {
29+
} _ => {
3030
panic!("Could not read file {}", ast_file.to_string_lossy());
31-
}
31+
}}
3232

3333
return deps
3434
.iter()

rewatch/src/build/parse.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -328,13 +328,13 @@ fn generate_ast(
328328
helpers::create_path(&ast_parent_path);
329329

330330
/* Create .ast */
331-
let result = if let Some(res_to_ast) = Some(
331+
let result = match Some(
332332
Command::new(bsc_path)
333333
.current_dir(&build_path_abs)
334334
.args(parser_args)
335335
.output()
336336
.expect("Error converting .res to .ast"),
337-
) {
337+
) { Some(res_to_ast) => {
338338
let stderr = std::str::from_utf8(&res_to_ast.stderr).expect("Expect StdErr to be non-null");
339339
if helpers::contains_ascii_characters(stderr) {
340340
if res_to_ast.status.success() {
@@ -345,15 +345,15 @@ fn generate_ast(
345345
} else {
346346
Ok((ast_path, None))
347347
}
348-
} else {
348+
} _ => {
349349
log::info!("Parsing file {}...", filename.display());
350350

351351
Err(format!(
352352
"Could not find canonicalize_string_path for file {} in package {}",
353353
filename.display(),
354354
package.name
355355
))
356-
};
356+
}};
357357
if let Ok((ast_path, _)) = &result {
358358
let _ = std::fs::copy(
359359
Path::new(&build_path_abs).join(&ast_path),

0 commit comments

Comments
 (0)