Add #[inline] attributes

This commit is contained in:
Pierre Krieger 2015-09-21 14:42:05 +02:00
parent 3820d307a3
commit aa9cb99929
23 changed files with 384 additions and 3 deletions

View file

@ -151,16 +151,19 @@ pub fn get_primary_monitor() -> MonitorID {
impl MonitorID {
/// See the docs if the crate root file.
#[inline]
pub fn get_name(&self) -> Option<String> {
Some(self.readable_name.clone())
}
/// See the docs of the crate root file.
#[inline]
pub fn get_native_identifier(&self) -> NativeMonitorId {
NativeMonitorId::Name(self.monitor_name.clone())
}
/// See the docs if the crate root file.
#[inline]
pub fn get_dimensions(&self) -> (u32, u32) {
// TODO: retreive the dimensions every time this is called
self.dimensions
@ -168,6 +171,7 @@ impl MonitorID {
/// This is a Win32-only function for `MonitorID` that returns the system name of the adapter
/// device.
#[inline]
pub fn get_adapter_name(&self) -> &[winapi::WCHAR] {
&self.adapter_name
}
@ -175,6 +179,7 @@ impl MonitorID {
/// This is a Win32-only function for `MonitorID` that returns the position of the
/// monitor on the desktop.
/// A window that is positionned at these coordinates will overlap the monitor.
#[inline]
pub fn get_position(&self) -> (u32, u32) {
self.position
}