Merge pull request 'Fixed regex error and ensured all area is backed up' (#1) from save_radius_fix into master
Reviewed-on: https://git.etztech.xyz/ZeroHD/Albatross/pulls/1backup_error_fix
commit
931faa84a9
|
@ -27,7 +27,7 @@ struct Region {
|
||||||
|
|
||||||
impl Region {
|
impl Region {
|
||||||
fn from_string(string: String) -> Option<Self> {
|
fn from_string(string: String) -> Option<Self> {
|
||||||
let re = Regex::new(r"r\.(?P<x>-?[0-9])+\.(?P<y>-?[0-9])").unwrap();
|
let re = Regex::new(r"r\.(?P<x>-?[0-9]*)+\.(?P<y>-?[0-9]*)").unwrap();
|
||||||
if re.is_match(string.as_str()) {
|
if re.is_match(string.as_str()) {
|
||||||
let captures = re.captures(string.as_str()).unwrap();
|
let captures = re.captures(string.as_str()).unwrap();
|
||||||
|
|
||||||
|
@ -90,11 +90,7 @@ fn backup_region(
|
||||||
backup_dir.push(dir_name);
|
backup_dir.push(dir_name);
|
||||||
create_dir(&backup_dir)?;
|
create_dir(&backup_dir)?;
|
||||||
|
|
||||||
let save_radius = if save_radius < 512 {
|
let save_radius = (save_radius as f64 / 512.0).ceil() as i64;
|
||||||
1 as i64
|
|
||||||
} else {
|
|
||||||
(save_radius / 512) as i64
|
|
||||||
};
|
|
||||||
|
|
||||||
for entry in src_dir.read_dir()? {
|
for entry in src_dir.read_dir()? {
|
||||||
let entry = entry?;
|
let entry = entry?;
|
||||||
|
|
Loading…
Reference in New Issue