summaryrefslogtreecommitdiff
path: root/src/sftp.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-11-18 09:10:37 -0800
committerAlex Crichton <alex@alexcrichton.com>2014-11-18 09:10:37 -0800
commit6118d76bb383420be32160af866cbe5fc7141f42 (patch)
tree8c7153acd116d165859f43017436c53158477400 /src/sftp.rs
parent84bea90ea3106c7f17857705fd2b3557ac236e02 (diff)
downloadssh2-rs-6118d76bb383420be32160af866cbe5fc7141f42.zip
Update to rust master
Diffstat (limited to 'src/sftp.rs')
-rw-r--r--src/sftp.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/sftp.rs b/src/sftp.rs
index 40b8c59..f5d042f 100644
--- a/src/sftp.rs
+++ b/src/sftp.rs
@@ -90,9 +90,9 @@ bitflags! {
/// How to open a file handle with libssh2.
pub enum OpenType {
/// Specify that a file shoud be opened.
- OpenFile = raw::LIBSSH2_SFTP_OPENFILE as int,
+ File = raw::LIBSSH2_SFTP_OPENFILE as int,
/// Specify that a directory should be opened.
- OpenDir = raw::LIBSSH2_SFTP_OPENDIR as int,
+ Dir = raw::LIBSSH2_SFTP_OPENDIR as int,
}
impl<'a> Sftp<'a> {
@@ -132,17 +132,17 @@ impl<'a> Sftp<'a> {
/// Helper to open a file in the `Read` mode.
pub fn open(&self, filename: &Path) -> Result<File, Error> {
- self.open_mode(filename, READ, io::USER_FILE, OpenFile)
+ self.open_mode(filename, READ, io::USER_FILE, OpenType::File)
}
/// Helper to create a file in write-only mode with truncation.
pub fn create(&self, filename: &Path) -> Result<File, Error> {
- self.open_mode(filename, WRITE | TRUNCATE, io::USER_FILE, OpenFile)
+ self.open_mode(filename, WRITE | TRUNCATE, io::USER_FILE, OpenType::File)
}
/// Helper to open a directory for reading its contents.
pub fn opendir(&self, dirname: &Path) -> Result<File, Error> {
- self.open_mode(dirname, READ, io::USER_FILE, OpenDir)
+ self.open_mode(dirname, READ, io::USER_FILE, OpenType::Dir)
}
/// Convenience function to read the files in a directory.