pub fn new(v: Vec<(Option<Name>, Value)>) -> Result<Self, Error> {
        let mut positional = Vec::new();
        let mut named = OrderMap::new();
        for (name, value) in v {
            if let Some(name) = name {
                if let Some(_old) = named.insert(name, value) {
                    return Err(Error::error("Duplicate argument."));
                }
            } else if named.is_empty() || is_splat(&value).is_some() {
                positional.push(value);
            } else {
                return Err(Error::error("positional arg after named."));
            }
        }
        Ok(CallArgs { positional, named })
    }
/// Create a new callargs from a vec of name-value pairs.
///
/// The names is none for positional arguments.
Create a new callargs from a vec of name-value pairs.
The names is none for positional arguments.
Create a new callargs from a vec of name - value pairs . The names is none for positional arguments .
pub fn new(v: Vec<(Option<Name>, Value)>) -> Result<Self, Error> {
        let mut positional = Vec::new();
        let mut named = OrderMap::new();
        for (name, value) in v {
            if let Some(name) = name {
                if let Some(_old) = named.insert(name, value) {
                    return Err(Error::error("Duplicate argument."));
                }
            } else if named.is_empty() || is_splat(&value).is_some() {
                positional.push(value);
            } else {
                return Err(Error::error("positional arg after named."));
            }
        }
        Ok(CallArgs { positional, named })
    }
pub fn new ( v : Vec < ( Option < Name > , Value ) > ) -> Result < Self , Error > { let mut positional = Vec :: new ( ) ; let mut named = OrderMap :: new ( ) ; for ( name , value ) in v { if let Some ( name ) = name { if let Some ( _old ) = named . insert ( name , value ) { return Err ( Error :: error ( " " ) ) ; } } else if named . is_empty ( ) || is_splat ( & value ) . is_some ( ) { positional . push ( value ) ; } else { return Err ( Error :: error ( " " ) ) ; } } Ok ( CallArgs { positional , named } ) }
Create a new callargs from a vec of name-value pairs.
Create a new callargs from a vec of name - value pairs .
v
Vec<(Option<Name>, Value)>
v
Vec<(Option<Name>, Value)>