Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Furrior committed May 13, 2024
1 parent d7364e0 commit f6f6c1c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Empty file removed src/error.rs
Empty file.
4 changes: 1 addition & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@

#[macro_use]
mod byond;
#[allow(dead_code)]
mod error;

pub mod transliteration;
pub mod regexp;
pub mod transliteration;

#[cfg(not(target_pointer_width = "32"))]
compile_error!("rust-utils must be compiled for a 32-bit target");
8 changes: 4 additions & 4 deletions src/regexp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ fn init_regex_cache() -> RegexCache {

static RE_CACHE: Mutex<Option<RegexCache>> = Mutex::new(None);


fn compile_regex(pattern: &str) -> regex::Regex {
let mut cache = RE_CACHE.lock().unwrap();
if let Some(ref mut cache) = *cache {
Expand All @@ -31,8 +30,6 @@ fn regexp_replace(text: &str, re: &str, re_params: &str, replacement: &str) -> S
re.replace_all(text, replacement).to_string()
}



#[cfg(test)]
mod tests {
use super::*;
Expand All @@ -50,7 +47,10 @@ mod tests {
let replacement = "попадание мячем";

for _ in 1..2 {
assert_eq!(expected_output, regexp_replace(input, pattern, pattern_flags, replacement));
assert_eq!(
expected_output,
regexp_replace(input, pattern, pattern_flags, replacement)
);
}
}
}

0 comments on commit f6f6c1c

Please sign in to comment.