Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergiu Pușcaș committed Oct 4, 2018
1 parent 53adee9 commit 3ef78c5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 20 deletions.
6 changes: 2 additions & 4 deletions src/gcsf/drive_facade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,10 @@ impl DriveFacade {
.next()
.ok_or(err_msg(
"No files on drive. Can't deduce drive id for 'My Drive'",
))?
.parents
))?.parents
.ok_or(err_msg(
"Probed file has no parents. Can't deduce drive id for 'My Drive'",
))?
.into_iter()
))?.into_iter()
.take(1)
.next()
.ok_or(err_msg(
Expand Down
22 changes: 11 additions & 11 deletions src/gcsf/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,15 @@ impl File {
&drive_file.modified_time,
&drive_file.viewed_by_me_time,
].iter()
.map(|time| {
match DateTime::parse_from_rfc3339(time.as_ref().unwrap_or(&String::new())) {
Ok(t) => Timespec {
sec: t.timestamp(),
nsec: t.timestamp_subsec_nanos() as i32,
},
Err(_) => Timespec { sec: 0, nsec: 0 },
}
})
.collect();
.map(
|time| match DateTime::parse_from_rfc3339(time.as_ref().unwrap_or(&String::new())) {
Ok(t) => Timespec {
sec: t.timestamp(),
nsec: t.timestamp_subsec_nanos() as i32,
},
Err(_) => Timespec { sec: 0, nsec: 0 },
},
).collect();

let (crtime, mtime, atime) = (times[0], times[1], times[2]);
let bsize = 512;
Expand Down Expand Up @@ -146,7 +145,8 @@ impl File {
self.drive_file
.as_ref()
.and_then(|f| f.mime_type.clone())
.map(|t| EXTENSIONS.contains_key::<str>(&t)) == Some(true)
.map(|t| EXTENSIONS.contains_key::<str>(&t))
== Some(true)
}

pub fn name(&self) -> String {
Expand Down
7 changes: 4 additions & 3 deletions src/gcsf/file_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,7 @@ impl FileManager {
.get_children(&id)
.ok_or(err_msg(
"FileManager::add_file_locally() could not get file siblings",
))?
.iter()
))?.iter()
.filter(|child| child.name == file.name)
.count();

Expand Down Expand Up @@ -488,7 +487,9 @@ impl FileManager {
.filter(|child| child.name == new_name)
.count();

let file = self.get_mut_file(&id).ok_or(err_msg("File doesn't exist"))?;
let file = self
.get_mut_file(&id)
.ok_or(err_msg("File doesn't exist"))?;
file.name = new_name.clone();

if identical_filename_count > 0 {
Expand Down
3 changes: 1 addition & 2 deletions src/gcsf/filesystem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ impl Filesystem for GCSF {
let id = f.drive_id().unwrap();

(mime, id)
})
.unwrap();
}).unwrap();

reply.data(
self.manager
Expand Down

0 comments on commit 3ef78c5

Please sign in to comment.