fn read_principals(buf: &[u8]) -> Result<Vec<String>> {
    let mut reader = Reader::new(&buf);
    let mut items = Vec::new();

    loop {
        let principal = match reader.read_string() {
            Ok(v) => v,
            Err(e) => match e {
                Error::UnexpectedEof => break,
                _ => return Err(e),
            },
        };

        items.push(principal);
    }

    Ok(items)
}
// Reads the `principals` field of a certificate key.
// The `principals` are represented as a sequence of `string` values
// embedded in a buffer.
// This function reads the whole byte slice until EOF is reached in order to
// ensure all principals are read from the byte slice.
Reads the `principals` field of a certificate key.
The `principals` are represented as a sequence of `string` values
embedded in a buffer.
This function reads the whole byte slice until EOF is reached in order to
ensure all principals are read from the byte slice.
Reads the ` principals ` field of a certificate key . The ` principals ` are represented as a sequence of ` string ` values embedded in a buffer . This function reads the whole byte slice until EOF is reached in order to ensure all principals are read from the byte slice .
fn read_principals(buf: &[u8]) -> Result<Vec<String>> {
    let mut reader = Reader::new(&buf);
    let mut items = Vec::new();
    loop {
        let principal = match reader.read_string() {
            Ok(v) => v,
            Err(e) => match e {
                Error::UnexpectedEof => break,
                _ => return Err(e),
            },
        };
        items.push(principal);
    }
    Ok(items)
}
fn read_principals ( buf : & [ u8 ] ) -> Result < Vec < String > > { let mut reader = Reader :: new ( & buf ) ; let mut items = Vec :: new ( ) ; loop { let principal = match reader . read_string ( ) { Ok ( v ) => v , Err ( e ) => match e { Error :: UnexpectedEof => break , _ => return Err ( e ) , } , } ; items . push ( principal ) ; } Ok ( items ) }
Reads the `principals` field of a certificate key.
Reads the ` principals ` field of a certificate key .
buf
&[u8]