From acf2c86930f67cd8b438a536d598290c51de73ec Mon Sep 17 00:00:00 2001 From: Kornel Date: Fri, 8 May 2020 11:42:06 +0100 Subject: [PATCH] Fix style warnings --- cocoa/src/appkit.rs | 12 +++++----- core-graphics/src/base.rs | 10 ++++---- core-graphics/src/image.rs | 8 +++---- core-text/src/font.rs | 6 ++--- core-text/src/font_descriptor.rs | 40 ++++++++++++++++---------------- 5 files changed, 38 insertions(+), 38 deletions(-) diff --git a/cocoa/src/appkit.rs b/cocoa/src/appkit.rs index 71765a6..b7cfb22 100644 --- a/cocoa/src/appkit.rs +++ b/cocoa/src/appkit.rs @@ -1819,13 +1819,13 @@ impl NSView for id { unsafe fn frame(self) -> NSRect { msg_send![self, frame] } - + unsafe fn setFrameSize(self, frameSize: NSSize) { - msg_send![self, setFrameSize:frameSize] + msg_send![self, setFrameSize:frameSize] } - + unsafe fn setFrameOrigin(self, frameOrigin: NSPoint) { - msg_send![self, setFrameOrigin:frameOrigin] + msg_send![self, setFrameOrigin:frameOrigin] } unsafe fn display_(self) { @@ -2983,7 +2983,7 @@ pub trait NSButton: Sized { msg_send![class!(NSButton), alloc] } unsafe fn initWithFrame_(self, frameRect: NSRect) -> id; - unsafe fn setTarget_(self, target: id /* Instance */); + unsafe fn setTarget_(self, target: id /* Instance */); unsafe fn setAction_(self, selector: objc::runtime::Sel /* (Instance *) */); } @@ -3660,7 +3660,7 @@ pub trait NSTabView: Sized { unsafe fn allowsTruncatedLabels(self) -> BOOL; unsafe fn setAllowsTruncatedLabels_(self, allowTruncatedLabels:BOOL); unsafe fn setDelegate_(self, delegate:id); - unsafe fn delegate(self) -> id ; + unsafe fn delegate(self) -> id; unsafe fn tabViewAtPoint_(self, point:id) -> id; } diff --git a/core-graphics/src/base.rs b/core-graphics/src/base.rs index 89ca6b0..bb27396 100644 --- a/core-graphics/src/base.rs +++ b/core-graphics/src/base.rs @@ -36,11 +36,11 @@ pub const kCGImageAlphaFirst: u32 = 4; pub const kCGImageAlphaNoneSkipLast: u32 = 5; pub const kCGImageAlphaNoneSkipFirst: u32 = 6; -pub const kCGBitmapByteOrderDefault: u32 = (0 << 12); -pub const kCGBitmapByteOrder16Little: u32 = (1 << 12); -pub const kCGBitmapByteOrder32Little: u32 = (2 << 12); -pub const kCGBitmapByteOrder16Big: u32 = (3 << 12); -pub const kCGBitmapByteOrder32Big: u32 = (4 << 12); +pub const kCGBitmapByteOrderDefault: u32 = 0 << 12; +pub const kCGBitmapByteOrder16Little: u32 = 1 << 12; +pub const kCGBitmapByteOrder32Little: u32 = 2 << 12; +pub const kCGBitmapByteOrder16Big: u32 = 3 << 12; +pub const kCGBitmapByteOrder32Big: u32 = 4 << 12; pub const kCGRenderingIntentDefault: u32 = 0; pub const kCGRenderingIntentAbsoluteColorimetric: u32 = 1; diff --git a/core-graphics/src/image.rs b/core-graphics/src/image.rs index 84945e8..f1b9509 100644 --- a/core-graphics/src/image.rs +++ b/core-graphics/src/image.rs @@ -24,10 +24,10 @@ pub enum CGImageAlphaInfo { #[repr(C)] pub enum CGImageByteOrderInfo { CGImageByteOrderMask = 0x7000, - CGImageByteOrder16Little = (1 << 12), - CGImageByteOrder32Little = (2 << 12), - CGImageByteOrder16Big = (3 << 12), - CGImageByteOrder32Big = (4 << 12) + CGImageByteOrder16Little = 1 << 12, + CGImageByteOrder32Little = 2 << 12, + CGImageByteOrder16Big = 3 << 12, + CGImageByteOrder32Big = 4 << 12 } foreign_type! { diff --git a/core-text/src/font.rs b/core-text/src/font.rs index 7fb6787..5386017 100644 --- a/core-text/src/font.rs +++ b/core-text/src/font.rs @@ -70,12 +70,12 @@ pub type CTFontTableTag = u32; pub type CTFontTableOptions = u32; pub const kCTFontTableOptionsNoOptions: CTFontTableOptions = 0; -pub const kCTFontTableOptionsExcludeSynthetic: CTFontTableOptions = (1 << 0); +pub const kCTFontTableOptionsExcludeSynthetic: CTFontTableOptions = 1 << 0; pub type CTFontOptions = CFOptionFlags; pub const kCTFontOptionsDefault: CTFontOptions = 0; -pub const kCTFontOptionsPreventAutoActivation: CTFontOptions = (1 << 0); -pub const kCTFontOptionsPreferSystemFont: CTFontOptions = (1 << 2); +pub const kCTFontOptionsPreventAutoActivation: CTFontOptions = 1 << 0; +pub const kCTFontOptionsPreferSystemFont: CTFontOptions = 1 << 2; #[repr(C)] pub struct __CTFont(c_void); diff --git a/core-text/src/font_descriptor.rs b/core-text/src/font_descriptor.rs index 9359d30..0b623e8 100644 --- a/core-text/src/font_descriptor.rs +++ b/core-text/src/font_descriptor.rs @@ -36,15 +36,15 @@ pub const kCTFontFormatBitmap: CTFontFormat = 5; pub const kCTFontClassMaskShift: u32 = 28; pub type CTFontSymbolicTraits = u32; -pub const kCTFontItalicTrait: CTFontSymbolicTraits = (1 << 0); -pub const kCTFontBoldTrait: CTFontSymbolicTraits = (1 << 1); -pub const kCTFontExpandedTrait: CTFontSymbolicTraits = (1 << 5); -pub const kCTFontCondensedTrait: CTFontSymbolicTraits = (1 << 6); -pub const kCTFontMonoSpaceTrait: CTFontSymbolicTraits = (1 << 10); -pub const kCTFontVerticalTrait: CTFontSymbolicTraits = (1 << 11); -pub const kCTFontUIOptimizedTrait: CTFontSymbolicTraits = (1 << 12); -pub const kCTFontColorGlyphsTrait: CTFontSymbolicTraits = (1 << 13); -pub const kCTFontClassMaskTrait: CTFontSymbolicTraits = (15 << kCTFontClassMaskShift ); +pub const kCTFontItalicTrait: CTFontSymbolicTraits = 1 << 0; +pub const kCTFontBoldTrait: CTFontSymbolicTraits = 1 << 1; +pub const kCTFontExpandedTrait: CTFontSymbolicTraits = 1 << 5; +pub const kCTFontCondensedTrait: CTFontSymbolicTraits = 1 << 6; +pub const kCTFontMonoSpaceTrait: CTFontSymbolicTraits = 1 << 10; +pub const kCTFontVerticalTrait: CTFontSymbolicTraits = 1 << 11; +pub const kCTFontUIOptimizedTrait: CTFontSymbolicTraits = 1 << 12; +pub const kCTFontColorGlyphsTrait: CTFontSymbolicTraits = 1 << 13; +pub const kCTFontClassMaskTrait: CTFontSymbolicTraits = 15 << kCTFontClassMaskShift; pub trait SymbolicTraitAccessors { fn is_italic(&self) -> bool; @@ -65,17 +65,17 @@ impl SymbolicTraitAccessors for CTFontSymbolicTraits { } pub type CTFontStylisticClass = u32; -pub const kCTFontUnknownClass: CTFontStylisticClass = (0 << kCTFontClassMaskShift ); -pub const kCTFontOldStyleSerifsClass: CTFontStylisticClass = (1 << kCTFontClassMaskShift ); -pub const kCTFontTransitionalSerifsClass: CTFontStylisticClass = (2 << kCTFontClassMaskShift ); -pub const kCTFontModernSerifsClass: CTFontStylisticClass = (3 << kCTFontClassMaskShift ); -pub const kCTFontClarendonSerifsClass: CTFontStylisticClass = (4 << kCTFontClassMaskShift ); -pub const kCTFontSlabSerifsClass: CTFontStylisticClass = (5 << kCTFontClassMaskShift ); -pub const kCTFontFreeformSerifsClass: CTFontStylisticClass = (7 << kCTFontClassMaskShift ); -pub const kCTFontSansSerifClass: CTFontStylisticClass = (8 << kCTFontClassMaskShift ); -pub const kCTFontOrnamentalsClass: CTFontStylisticClass = (9 << kCTFontClassMaskShift ); -pub const kCTFontScriptsClass: CTFontStylisticClass = (10 << kCTFontClassMaskShift ); -pub const kCTFontSymbolicClass: CTFontStylisticClass = (12 << kCTFontClassMaskShift ); +pub const kCTFontUnknownClass: CTFontStylisticClass = 0 << kCTFontClassMaskShift; +pub const kCTFontOldStyleSerifsClass: CTFontStylisticClass = 1 << kCTFontClassMaskShift; +pub const kCTFontTransitionalSerifsClass: CTFontStylisticClass = 2 << kCTFontClassMaskShift; +pub const kCTFontModernSerifsClass: CTFontStylisticClass = 3 << kCTFontClassMaskShift; +pub const kCTFontClarendonSerifsClass: CTFontStylisticClass = 4 << kCTFontClassMaskShift; +pub const kCTFontSlabSerifsClass: CTFontStylisticClass = 5 << kCTFontClassMaskShift; +pub const kCTFontFreeformSerifsClass: CTFontStylisticClass = 7 << kCTFontClassMaskShift; +pub const kCTFontSansSerifClass: CTFontStylisticClass = 8 << kCTFontClassMaskShift; +pub const kCTFontOrnamentalsClass: CTFontStylisticClass = 9 << kCTFontClassMaskShift; +pub const kCTFontScriptsClass: CTFontStylisticClass = 10 << kCTFontClassMaskShift; +pub const kCTFontSymbolicClass: CTFontStylisticClass = 12 << kCTFontClassMaskShift; pub trait StylisticClassAccessors { fn is_serif(&self) -> bool;