Browse Source

Update crates to 2018

pull/13/head
AzureMarker 3 years ago
parent
commit
72dafc7fc2
No known key found for this signature in database
GPG Key ID: 47A133F3BF9D03D3
  1. 1
      ctru-rs/Cargo.toml
  2. 26
      ctru-rs/src/services/fs.rs
  3. 1
      ctru-sys/Cargo.toml

1
ctru-rs/Cargo.toml

@ -4,6 +4,7 @@ description = "A safe wrapper around smealum's ctrulib." @@ -4,6 +4,7 @@ description = "A safe wrapper around smealum's ctrulib."
license = "https://en.wikipedia.org/wiki/Zlib_License"
name = "ctru-rs"
version = "0.7.1"
edition = "2018"
[lib]
crate-type = ["rlib"]

26
ctru-rs/src/services/fs.rs

@ -317,7 +317,7 @@ impl Fs { @@ -317,7 +317,7 @@ impl Fs {
let path = ctru_sys::fsMakePath(PathType::Empty.into(), ptr::null() as _);
let r = ctru_sys::FSUSER_OpenArchive(&mut handle, id.into(), path);
if r < 0 {
Err(::Error::from(r))
Err(crate::Error::from(r))
} else {
Ok(Archive {
handle: handle,
@ -410,7 +410,7 @@ impl File { @@ -410,7 +410,7 @@ impl File {
if r < 0 {
Err(IoError::new(
IoErrorKind::PermissionDenied,
::Error::from(r),
crate::Error::from(r),
))
} else {
Ok(())
@ -428,7 +428,7 @@ impl File { @@ -428,7 +428,7 @@ impl File {
if r < 0 {
Err(IoError::new(
IoErrorKind::PermissionDenied,
::Error::from(r),
crate::Error::from(r),
))
} else {
Ok(Metadata {
@ -451,7 +451,7 @@ impl File { @@ -451,7 +451,7 @@ impl File {
);
self.offset += n_read as u64;
if r < 0 {
Err(IoError::new(IoErrorKind::Other, ::Error::from(r)))
Err(IoError::new(IoErrorKind::Other, crate::Error::from(r)))
} else {
Ok(n_read as usize)
}
@ -475,7 +475,7 @@ impl File { @@ -475,7 +475,7 @@ impl File {
);
self.offset += n_written as u64;
if r < 0 {
Err(IoError::new(IoErrorKind::Other, ::Error::from(r)))
Err(IoError::new(IoErrorKind::Other, crate::Error::from(r)))
} else {
Ok(n_written as usize)
}
@ -612,7 +612,7 @@ impl OpenOptions { @@ -612,7 +612,7 @@ impl OpenOptions {
0,
);
if r < 0 {
return Err(IoError::new(IoErrorKind::Other, ::Error::from(r)));
return Err(IoError::new(IoErrorKind::Other, crate::Error::from(r)));
}
let mut file = File {
@ -670,7 +670,7 @@ impl<'a> Iterator for ReadDir<'a> { @@ -670,7 +670,7 @@ impl<'a> Iterator for ReadDir<'a> {
);
if r < 0 {
return Some(Err(IoError::new(IoErrorKind::Other, ::Error::from(r))));
return Some(Err(IoError::new(IoErrorKind::Other, crate::Error::from(r))));
}
if entries_read != entry_count {
return None;
@ -723,7 +723,7 @@ pub fn create_dir<P: AsRef<Path>>(arch: &Archive, path: P) -> IoResult<()> { @@ -723,7 +723,7 @@ pub fn create_dir<P: AsRef<Path>>(arch: &Archive, path: P) -> IoResult<()> {
FsAttribute::FS_ATTRIBUTE_DIRECTORY.bits(),
);
if r < 0 {
Err(IoError::new(IoErrorKind::Other, ::Error::from(r)))
Err(IoError::new(IoErrorKind::Other, crate::Error::from(r)))
} else {
Ok(())
}
@ -781,7 +781,7 @@ pub fn remove_dir<P: AsRef<Path>>(arch: &Archive, path: P) -> IoResult<()> { @@ -781,7 +781,7 @@ pub fn remove_dir<P: AsRef<Path>>(arch: &Archive, path: P) -> IoResult<()> {
let fs_path = ctru_sys::fsMakePath(PathType::UTF16.into(), path.as_ptr() as _);
let r = ctru_sys::FSUSER_DeleteDirectory(arch.handle, fs_path);
if r < 0 {
Err(IoError::new(IoErrorKind::Other, ::Error::from(r)))
Err(IoError::new(IoErrorKind::Other, crate::Error::from(r)))
} else {
Ok(())
}
@ -799,7 +799,7 @@ pub fn remove_dir_all<P: AsRef<Path>>(arch: &Archive, path: P) -> IoResult<()> { @@ -799,7 +799,7 @@ pub fn remove_dir_all<P: AsRef<Path>>(arch: &Archive, path: P) -> IoResult<()> {
let fs_path = ctru_sys::fsMakePath(PathType::UTF16.into(), path.as_ptr() as _);
let r = ctru_sys::FSUSER_DeleteDirectoryRecursively(arch.handle, fs_path);
if r < 0 {
Err(IoError::new(IoErrorKind::Other, ::Error::from(r)))
Err(IoError::new(IoErrorKind::Other, crate::Error::from(r)))
} else {
Ok(())
}
@ -825,7 +825,7 @@ pub fn read_dir<P: AsRef<Path>>(arch: &Archive, path: P) -> IoResult<ReadDir> { @@ -825,7 +825,7 @@ pub fn read_dir<P: AsRef<Path>>(arch: &Archive, path: P) -> IoResult<ReadDir> {
let fs_path = ctru_sys::fsMakePath(PathType::UTF16.into(), path.as_ptr() as _);
let r = ctru_sys::FSUSER_OpenDirectory(&mut handle, arch.handle, fs_path);
if r < 0 {
Err(IoError::new(IoErrorKind::Other, ::Error::from(r)))
Err(IoError::new(IoErrorKind::Other, crate::Error::from(r)))
} else {
Ok(ReadDir {
handle: Dir(handle),
@ -851,7 +851,7 @@ pub fn remove_file<P: AsRef<Path>>(arch: &Archive, path: P) -> IoResult<()> { @@ -851,7 +851,7 @@ pub fn remove_file<P: AsRef<Path>>(arch: &Archive, path: P) -> IoResult<()> {
let fs_path = ctru_sys::fsMakePath(PathType::UTF16.into(), path.as_ptr() as _);
let r = ctru_sys::FSUSER_DeleteFile(arch.handle, fs_path);
if r < 0 {
Err(IoError::new(IoErrorKind::Other, ::Error::from(r)))
Err(IoError::new(IoErrorKind::Other, crate::Error::from(r)))
} else {
Ok(())
}
@ -888,7 +888,7 @@ where @@ -888,7 +888,7 @@ where
if r == 0 {
return Ok(());
}
Err(IoError::new(IoErrorKind::Other, ::Error::from(r)))
Err(IoError::new(IoErrorKind::Other, crate::Error::from(r)))
}
}

1
ctru-sys/Cargo.toml

@ -4,6 +4,7 @@ version = "0.4.0" @@ -4,6 +4,7 @@ version = "0.4.0"
authors = ["Ronald Kinard <furyhunter600@gmail.com>"]
license = "https://en.wikipedia.org/wiki/Zlib_License"
links = "ctru"
edition = "2018"
[dependencies]
libc = { version = "0.2", default-features = false }

Loading…
Cancel
Save