Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multi-arg rhofunc code #62

Open
wants to merge 2 commits into
base: rholang_func
Choose a base branch
from
Open

Add multi-arg rhofunc code #62

wants to merge 2 commits into from

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.

None yet

2 participants