diff options
Diffstat (limited to 'font/src/ft/fc/pattern.rs')
-rw-r--r-- | font/src/ft/fc/pattern.rs | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/font/src/ft/fc/pattern.rs b/font/src/ft/fc/pattern.rs index 53641f67..f40cc9c9 100644 --- a/font/src/ft/fc/pattern.rs +++ b/font/src/ft/fc/pattern.rs @@ -54,7 +54,7 @@ impl<'a> StringPropertyIter<'a> { }; if result == FcResultMatch { - // Transmute here is to extend lifetime of the str to that of the iterator + // Transmute here is to extend lifetime of the str to that of the iterator. // // Potential unsafety? What happens if the pattern is modified while this ptr is // borrowed out? @@ -67,7 +67,7 @@ impl<'a> StringPropertyIter<'a> { } } -/// Iterator over integer properties +/// Iterator over integer properties. pub struct BooleanPropertyIter<'a> { pattern: &'a PatternRef, object: &'a [u8], @@ -99,7 +99,7 @@ impl<'a> BooleanPropertyIter<'a> { } } -/// Iterator over integer properties +/// Iterator over integer properties. pub struct IntPropertyIter<'a> { pattern: &'a PatternRef, object: &'a [u8], @@ -204,7 +204,7 @@ impl<'a> LcdFilterPropertyIter<'a> { } } -/// Iterator over integer properties +/// Iterator over integer properties. pub struct DoublePropertyIter<'a> { pattern: &'a PatternRef, object: &'a [u8], @@ -236,7 +236,7 @@ impl<'a> DoublePropertyIter<'a> { } } -/// Implement debug for a property iterator +/// Implement debug for a property iterator. macro_rules! impl_property_iter_debug { ($iter:ty => $item:ty) => { impl<'a> fmt::Debug for $iter { @@ -260,7 +260,7 @@ macro_rules! impl_property_iter_debug { }; } -/// Implement Iterator and Debug for a property iterator +/// Implement Iterator and Debug for a property iterator. macro_rules! impl_property_iter { ($($iter:ty => $item:ty),*) => { $( @@ -310,7 +310,7 @@ macro_rules! impl_derived_property_iter { } } -// Basic Iterators +// Basic Iterators. impl_property_iter! { StringPropertyIter<'a> => &'a str, IntPropertyIter<'a> => isize, @@ -318,7 +318,7 @@ impl_property_iter! { BooleanPropertyIter<'a> => bool } -// Derived Iterators +// Derived Iterators. impl_derived_property_iter! { RgbaPropertyIter<'a> => Rgba, HintStylePropertyIter<'a> => HintStyle, @@ -460,23 +460,23 @@ impl PatternRef { index() => b"index\0" } - // Prints the pattern to stdout - // - // FontConfig doesn't expose a way to iterate over all members of a pattern; - // instead, we just defer to FcPatternPrint. Otherwise, this could have been - // a `fmt::Debug` impl. + /// Prints the pattern to stdout. + /// + /// FontConfig doesn't expose a way to iterate over all members of a pattern; + /// instead, we just defer to FcPatternPrint. Otherwise, this could have been + /// a `fmt::Debug` impl. pub fn print(&self) { unsafe { FcPatternPrint(self.as_ptr()) } } - /// Add a string value to the pattern + /// Add a string value to the pattern. /// /// If the returned value is `true`, the value is added at the end of /// any existing list, otherwise it is inserted at the beginning. /// /// # Unsafety /// - /// `object` is not checked to be a valid null-terminated string + /// `object` is not checked to be a valid null-terminated string. unsafe fn add_string(&mut self, object: &[u8], value: &str) -> bool { let value = CString::new(&value[..]).unwrap(); let value = value.as_ptr(); @@ -556,9 +556,9 @@ impl PatternRef { unsafe { PatternHash(FcPatternHash(self.as_ptr())) } } - /// Add charset to the pattern + /// Add charset to the pattern. /// - /// The referenced charset is copied by fontconfig internally using + /// The referenced charset is copied by Fontconfig internally using /// FcValueSave so that no references to application provided memory are /// retained. That is, the CharSet can be safely dropped immediately /// after being added to the pattern. |