Skip to content

Commit 5227f73

Browse files
committed
style: another rustfmt run
1 parent badf735 commit 5227f73

File tree

3 files changed

+26
-10
lines changed

3 files changed

+26
-10
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@
1515

1616
# Temporary files
1717
.*~
18+
19+
# Backup files
20+
*.bk

src/error.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ impl Error for CliError {
5050
match *self {
5151
CliError::Semver(_, ref s) => &*s,
5252
CliError::Generic(ref d) => &*d,
53-
CliError::Unknown => "An unknown fatal error has occurred, please consider filing a \
54-
bug-report!",
53+
CliError::Unknown =>
54+
"An unknown fatal error has occurred, please consider filing a bug-report!",
5555
}
5656
}
5757

src/main.rs

+21-8
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,13 @@ pub fn from_matches(matches: &ArgMatches) -> CliResult<Clog> {
109109
let mut clog = if let Some(cfg) = matches.value_of("config") {
110110
debugln!("User passed in config file: {:?}", cfg);
111111
if matches.is_present("workdir") && matches.is_present("gitdir") {
112-
debugln!("User passed in both\n\tworking dir: {:?}\n\tgit dir: {:?}", matches.value_of("workdir"), matches.value_of("gitdir"));
112+
debugln!("User passed in both\n\tworking dir: {:?}\n\tgit dir: {:?}",
113+
matches.value_of("workdir"),
114+
matches.value_of("gitdir"));
113115
// use --config --work-tree --git-dir
114116
try!(Clog::with_all(matches.value_of("gitdir").unwrap(),
115-
matches.value_of("workdir").unwrap(),
116-
cfg))
117+
matches.value_of("workdir").unwrap(),
118+
cfg))
117119
} else if let Some(dir) = matches.value_of("workdir") {
118120
debugln!("User passed in working dir: {:?}", dir);
119121
// use --config --work-tree
@@ -132,7 +134,9 @@ pub fn from_matches(matches: &ArgMatches) -> CliResult<Clog> {
132134
if matches.is_present("gitdir") && matches.is_present("workdir") {
133135
let wdir = matches.value_of("workdir").unwrap();
134136
let gdir = matches.value_of("gitdir").unwrap();
135-
debugln!("User passed in both\n\tworking dir: {:?}\n\tgit dir: {:?}", wdir, gdir);
137+
debugln!("User passed in both\n\tworking dir: {:?}\n\tgit dir: {:?}",
138+
wdir,
139+
gdir);
136140
try!(Clog::with_dirs(gdir, wdir))
137141
} else if let Some(dir) = matches.value_of("gitdir") {
138142
debugln!("User passed in git dir: {:?}", dir);
@@ -183,10 +187,19 @@ pub fn from_matches(matches: &ArgMatches) -> CliResult<Clog> {
183187
}
184188
_ => unreachable!(),
185189
}
186-
format!("{}{}", if had_v{"v"}else{""}, v)
190+
format!("{}{}",
191+
if had_v {
192+
"v"
193+
} else {
194+
""
195+
},
196+
v)
187197
}
188198
Err(e) => {
189-
return Err(CliError::Semver(Box::new(e), String::from("Failed to parse version into valid SemVer. Ensure the version is in the X.Y.Z format.")));
199+
return Err(CliError::Semver(Box::new(e),
200+
String::from("Failed to parse version into \
201+
valid SemVer. Ensure the version \
202+
is in the X.Y.Z format.")));
190203
}
191204
}
192205
} else {
@@ -205,8 +218,8 @@ pub fn from_matches(matches: &ArgMatches) -> CliResult<Clog> {
205218
}
206219

207220
if matches.is_present("link-style") {
208-
clog.link_style =
209-
value_t!(matches.value_of("link-style"), LinkStyle).unwrap_or(LinkStyle::Github);
221+
clog.link_style = value_t!(matches.value_of("link-style"), LinkStyle)
222+
.unwrap_or(LinkStyle::Github);
210223
}
211224

212225
if let Some(subtitle) = matches.value_of("subtitle") {

0 commit comments

Comments
 (0)