diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 650d458..6b17d72 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -76,7 +76,7 @@ jobs: - selinux-version: '3.7' rust-toolchain: nightly - selinux-version: '3.7' - rust-toolchain: 1.81 + rust-toolchain: 1.83 steps: - uses: actions/checkout@v3 - name: Checkout selinux userspace diff --git a/Cargo.toml b/Cargo.toml index 7ca8304..915b7eb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "selinux-cascade" version = "0.0.2" description = "A High Level Language for specifying SELinux policy" authors = ["Daniel Burgener ", "Mickael Salaun "] -edition = "2018" +edition = "2021" license = "MIT" repository = "https://github.com/dburgener/cascade" readme = "README.md" diff --git a/src/ast.rs b/src/ast.rs index 21c7249..a60637a 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -864,7 +864,7 @@ impl fmt::Display for Port { Some(high) => format!("{}-{}", self.low_port_num, high), None => self.low_port_num.to_string(), }; - write!(f, "{}", port_string) + write!(f, "{port_string}") } } @@ -1328,7 +1328,7 @@ mod tests { let result = if_block.get_renamed_statement(&renames); // matches!() won't work because matching against box patterns is nightly only - let debug_str = format!("{:?}", result); + let debug_str = format!("{result:?}"); assert!(debug_str.contains("new_name")); assert!(!debug_str.contains("old_name")); assert!(debug_str.contains("unchanged")); diff --git a/src/compile.rs b/src/compile.rs index 6bc708b..e0ddd4d 100644 --- a/src/compile.rs +++ b/src/compile.rs @@ -1534,7 +1534,7 @@ pub fn get_synthetic_resource_name( dom_name: &CascadeString, associated_resource: &CascadeString, ) -> CascadeString { - let cs_name = format!("{}.{}", dom_name, associated_resource); + let cs_name = format!("{dom_name}.{associated_resource}"); // We keep the range of the *resource* part specifically, which should always be where this // resource was defined match associated_resource.get_range() { diff --git a/src/functions.rs b/src/functions.rs index e0eea6f..93067f7 100644 --- a/src/functions.rs +++ b/src/functions.rs @@ -2226,7 +2226,7 @@ fn validate_cast( "Cannot typecast", file, r, - format!("This is not something that can be typecast. {}", msg).as_ref(), + format!("This is not something that can be typecast. {msg}").as_ref(), ) }; @@ -3408,7 +3408,7 @@ impl<'a> ArgForValidation<'a> { ) -> Result, ErrorItem> { let err_ret = |msg: &str, r: Option>| { ErrorItem::make_compile_or_internal_error( - format!("Cannot typecast {}", msg).as_ref(), + format!("Cannot typecast {msg}").as_ref(), file, r, "This is not something that can be typecast", @@ -3997,10 +3997,7 @@ pub fn search_for_recursion( "Recursive Function call found", file, range, - &format!( - "This function calls the next function: {}.", - previous_function - ), + &format!("This function calls the next function: {previous_function}."), )); previous_function = function_info.get_full_display_name(); } diff --git a/src/warning.rs b/src/warning.rs index 1321a29..42dde7b 100644 --- a/src/warning.rs +++ b/src/warning.rs @@ -122,7 +122,7 @@ mod tests { let mut ret = WithWarnings::from(warn_string); if do_warn { ret.add_warning(Warning::new( - &format!("Some warning {}", call_count), + &format!("Some warning {call_count}"), file, 2..4, // doesn't matter for the test "Some substring",