icu: Make Stringprep private and add helper functions
This makes the API easier to use.
This commit is contained in:
parent
8d4ed296d0
commit
4bfd85556d
2 changed files with 35 additions and 22 deletions
|
|
@ -11,7 +11,7 @@ use crate::Strict;
|
|||
use std::ptr::null_mut;
|
||||
|
||||
/// Struct representing a given stringprep profile.
|
||||
pub struct Stringprep {
|
||||
pub(crate) struct Stringprep {
|
||||
inner: *mut UStringPrepProfile,
|
||||
}
|
||||
|
||||
|
|
@ -30,7 +30,7 @@ impl Stringprep {
|
|||
///
|
||||
/// # Panics
|
||||
/// Panics if ICU doesn’t return a valid UTF-16 string, which should never happen.
|
||||
pub fn stringprep(&self, input: &str, strict: Strict) -> Result<String, Error> {
|
||||
pub(crate) fn stringprep(&self, input: &str, strict: Strict) -> Result<String, Error> {
|
||||
if input.len() > 1023 {
|
||||
return Err(Error::TooLong);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue