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

Add overwrite method for new fits files #94

Merged
merged 4 commits into from
Apr 4, 2018
Merged

Add overwrite method for new fits files #94

merged 4 commits into from
Apr 4, 2018

Conversation

simonrw
Copy link
Owner

@simonrw simonrw commented Apr 4, 2018

If a file already exists, then overwrite it.

See #93

@@ -864,6 +866,17 @@ where
let path = self.path.as_ref().to_str().expect("converting filename");
let c_filename = ffi::CString::new(path)?;

// Check if the overwrite flag is set
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is in the wrong place

if !self.overwrite {
return Err(Error::ExistingFile(path.to_owned()));
} else {
use std::fs::remove_file;
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This import and then instant use seems unnecessary

@simonrw simonrw merged commit 9120f41 into master Apr 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant