-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: rholang_func
Are you sure you want to change the base?
Conversation
) -> Result<String, Box<dyn Error>> { | ||
let mut rtc: String = rholang.to_string(); | ||
for a in args.keys() { | ||
let val = args.get(a).unwrap(); |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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() { |
There was a problem hiding this comment.
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>();
Add multiple argument capability