Skip to content

Commit 6e434a6

Browse files
committed
---
yaml --- r: 4419 b: refs/heads/master c: d4fe1b3 h: refs/heads/master i: 4417: 29fbe6e 4415: 3be859e v: v3
1 parent ba9a1a0 commit 6e434a6

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 6c0297cfe7f09194e6cc4aa6a7decf0fd7f3fdef
2+
refs/heads/master: d4fe1b312797fb311351d27d1dce0cec735c808f

trunk/src/lib/getopts.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -209,40 +209,40 @@ fn getopts_ivec(args: &str[], opts: &opt[]) -> result {
209209
ret success({opts: opts, vals: vals, free: free});
210210
}
211211

212-
fn opt_vals(m: match, nm: str) -> optval[] {
212+
fn opt_vals(m: &match, nm: str) -> optval[] {
213213
ret alt find_opt(m.opts, mkname(nm)) {
214214
some(id) { m.vals.(id) }
215215
none. { log_err "No option '" + nm + "' defined."; fail }
216216
};
217217
}
218218

219-
fn opt_val(m: match, nm: str) -> optval { ret opt_vals(m, nm).(0); }
219+
fn opt_val(m: &match, nm: str) -> optval { ret opt_vals(m, nm).(0); }
220220

221-
fn opt_present(m: match, nm: str) -> bool {
221+
fn opt_present(m: &match, nm: str) -> bool {
222222
ret ivec::len[optval](opt_vals(m, nm)) > 0u;
223223
}
224224

225-
fn opt_str(m: match, nm: str) -> str {
225+
fn opt_str(m: &match, nm: str) -> str {
226226
ret alt opt_val(m, nm) { val(s) { s } _ { fail } };
227227
}
228228

229-
fn opt_strs(m: match, nm: str) -> vec[str] {
229+
fn opt_strs(m: &match, nm: str) -> vec[str] {
230230
let acc: vec[str] = [];
231231
for v: optval in opt_vals(m, nm) {
232232
alt v { val(s) { acc += [s]; } _ { } }
233233
}
234234
ret acc;
235235
}
236236

237-
fn opt_strs_ivec(m: match, nm: str) -> str[] {
237+
fn opt_strs_ivec(m: &match, nm: str) -> str[] {
238238
let acc: str[] = ~[];
239239
for v: optval in opt_vals(m, nm) {
240240
alt v { val(s) { acc += ~[s]; } _ { } }
241241
}
242242
ret acc;
243243
}
244244

245-
fn opt_maybe_str(m: match, nm: str) -> option::t[str] {
245+
fn opt_maybe_str(m: &match, nm: str) -> option::t[str] {
246246
let vals = opt_vals(m, nm);
247247
if ivec::len[optval](vals) == 0u { ret none[str]; }
248248
ret alt vals.(0) { val(s) { some[str](s) } _ { none[str] } };
@@ -252,7 +252,7 @@ fn opt_maybe_str(m: match, nm: str) -> option::t[str] {
252252
/// Returns none if the option was not present, `def` if the option was
253253
/// present but no argument was provided, and the argument if the option was
254254
/// present and an argument was provided.
255-
fn opt_default(m: match, nm: str, def: str) -> option::t[str] {
255+
fn opt_default(m: &match, nm: str, def: str) -> option::t[str] {
256256
let vals = opt_vals(m, nm);
257257
if ivec::len[optval](vals) == 0u { ret none[str]; }
258258
ret alt vals.(0) { val(s) { some[str](s) } _ { some[str](def) } }

0 commit comments

Comments
 (0)