Skip to content

Conversation

@Bill-Kunj
Copy link
Contributor

Add multiple argument capability

@Bill-Kunj Bill-Kunj added the enhancement New feature or request label Jun 12, 2023
) -> Result<String, Box<dyn Error>> {
let mut rtc: String = rholang.to_string();
for a in args.keys() {
let val = args.get(a).unwrap();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we return the error here instead?

let mut rtc: String = rholang.to_string();
for a in args.keys() {
let val = args.get(a).unwrap();
rtc = parse_simple(&rtc, a, val).unwrap().to_string();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

args: &BTreeMap<String, String>,
) -> Result<String, Box<dyn Error>> {
let mut rtc: String = rholang.to_string();
for a in args.keys() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could use the iter-map-collect property here

eg

a.iter().map(|(key, value)| {
//use key value here
}).collect::<String>();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants