Skip to content

Commit 4bccd89

Browse files
committed
Fix CLI bugs downcasting
1 parent 1df69f7 commit 4bccd89

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ license = "MIT"
66
name = "atomic-cli"
77
readme = "README.md"
88
repository = "https://github.com/atomicdata-dev/atomic-data-rust"
9-
version = "0.34.3"
9+
version = "0.34.4"
1010

1111
[dependencies]
1212
atomic_lib = {version = "0.34.3", path = "../lib", features = ["config", "rdf"]}

cli/src/commit.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ fn argument_to_string(context: &Context, argument: &str) -> AtomicResult<String>
6262
let command_name = context.matches.subcommand_name().unwrap();
6363
let subcommand_matches = context.matches.subcommand_matches(command_name).unwrap();
6464
let user_arg = subcommand_matches
65-
.get_one::<&str>(argument)
65+
.get_one::<String>(argument)
6666
.ok_or(format!("No argument value for {} found", argument))?;
6767
Ok(user_arg.to_string())
6868
}
@@ -72,13 +72,13 @@ fn argument_to_url(context: &Context, argument: &str) -> AtomicResult<String> {
7272
let command_name = context.matches.subcommand_name().unwrap();
7373
let subcommand_matches = context.matches.subcommand_matches(command_name).unwrap();
7474
let user_arg = subcommand_matches
75-
.get_one::<&str>(argument)
75+
.get_one::<String>(argument)
7676
.ok_or(format!("No argument value for {} found", argument))?;
7777
let id_url: String = context
7878
.mapping
7979
.lock()
8080
.unwrap()
81-
.try_mapping_or_url(&String::from(user_arg.to_string()))
81+
.try_mapping_or_url(&String::from(user_arg))
8282
.ok_or(&*format!("No url found for {}", user_arg))?;
8383
Ok(id_url)
8484
}

cli/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,9 @@ fn list(context: &mut Context) {
294294
/// Triple Pattern Fragment Query
295295
fn tpf(context: &Context) -> AtomicResult<()> {
296296
let subcommand_matches = context.matches.subcommand_matches("tpf").unwrap();
297-
let subject = tpf_value(subcommand_matches.get_one::<&str>("subject").unwrap());
298-
let property = tpf_value(subcommand_matches.get_one::<&str>("property").unwrap());
299-
let value = tpf_value(subcommand_matches.get_one::<&str>("value").unwrap());
297+
let subject = tpf_value(subcommand_matches.get_one::<String>("subject").unwrap());
298+
let property = tpf_value(subcommand_matches.get_one::<String>("property").unwrap());
299+
let value = tpf_value(subcommand_matches.get_one::<String>("value").unwrap());
300300
let endpoint = format!("{}/tpf", &context.get_write_context().server);
301301
let resources =
302302
atomic_lib::client::fetch_tpf(&endpoint, subject, property, value, &context.store)?;

0 commit comments

Comments
 (0)