Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to 2018 edition #642

Merged
merged 1 commit into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cocoa-foundation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ repository = "https://github.com/servo/core-foundation-rs"
version = "0.1.2"
authors = ["The Servo Project Developers"]
license = "MIT OR Apache-2.0"
edition = "2018"

[package.metadata.docs.rs]
default-target = "x86_64-apple-darwin"
Expand Down
4 changes: 2 additions & 2 deletions cocoa-foundation/src/foundation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#![allow(non_upper_case_globals)]

use base::{id, nil, BOOL, NO, SEL};
use crate::base::{id, nil, BOOL, NO, SEL};
use block::Block;
use libc;
use std::os::raw::c_void;
Expand All @@ -32,7 +32,7 @@ const UTF8_ENCODING: usize = 4;

#[cfg(target_os = "macos")]
mod macos {
use base::id;
use crate::base::id;
use core_graphics_types::base::CGFloat;
use core_graphics_types::geometry::CGRect;
use objc;
Expand Down
1 change: 1 addition & 0 deletions cocoa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ repository = "https://github.com/servo/core-foundation-rs"
version = "0.25.0"
authors = ["The Servo Project Developers"]
license = "MIT OR Apache-2.0"
edition = "2018"

[package.metadata.docs.rs]
default-target = "x86_64-apple-darwin"
Expand Down
6 changes: 3 additions & 3 deletions cocoa/src/appkit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@

#![allow(non_upper_case_globals)]

use base::{id, BOOL, SEL};
use block::Block;
use foundation::{
use crate::base::{id, BOOL, SEL};
use crate::foundation::{
NSInteger, NSPoint, NSRange, NSRect, NSRectEdge, NSSize, NSTimeInterval, NSUInteger,
};
use block::Block;
use libc;

pub use core_graphics::base::CGFloat;
Expand Down
8 changes: 4 additions & 4 deletions cocoa/src/quartzcore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ use foreign_types::ForeignType;
use std::ops::Mul;
use std::ptr;

use appkit::CGLContextObj;
use base::{id, nil, BOOL, YES};
use foundation::NSUInteger;
use crate::appkit::CGLContextObj;
use crate::base::{id, nil, BOOL, YES};
use crate::foundation::NSUInteger;

// CABase.h

Expand Down Expand Up @@ -1356,7 +1356,7 @@ pub mod transaction {
use core_foundation::date::CFTimeInterval;
use core_foundation::string::CFString;

use base::{id, BOOL, YES};
use crate::base::{id, BOOL, YES};

#[inline]
pub fn begin() {
Expand Down
1 change: 1 addition & 0 deletions core-foundation-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ repository = "https://github.com/servo/core-foundation-rs"
version = "0.8.6"
authors = ["The Servo Project Developers"]
license = "MIT OR Apache-2.0"
edition = "2018"

[dependencies]

Expand Down
4 changes: 2 additions & 2 deletions core-foundation-sys/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

use std::os::raw::c_void;

use base::{Boolean, CFAllocatorRef, CFComparatorFunction, CFIndex, CFRange, CFTypeID};
use string::CFStringRef;
use crate::base::{Boolean, CFAllocatorRef, CFComparatorFunction, CFIndex, CFRange, CFTypeID};
use crate::string::CFStringRef;

pub type CFArrayRetainCallBack =
extern "C" fn(allocator: CFAllocatorRef, value: *const c_void) -> *const c_void;
Expand Down
8 changes: 4 additions & 4 deletions core-foundation-sys/src/attributed_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use base::{Boolean, CFAllocatorRef, CFIndex, CFRange, CFTypeID, CFTypeRef};
use dictionary::CFDictionaryRef;
use crate::base::{Boolean, CFAllocatorRef, CFIndex, CFRange, CFTypeID, CFTypeRef};
use crate::dictionary::CFDictionaryRef;
use crate::string::CFMutableStringRef;
use crate::string::CFStringRef;
use std::os::raw::c_void;
use string::CFMutableStringRef;
use string::CFStringRef;

#[repr(C)]
pub struct __CFAttributedString(c_void);
Expand Down
4 changes: 2 additions & 2 deletions core-foundation-sys/src/bag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

use std::os::raw::c_void;

use base::{Boolean, CFAllocatorRef, CFHashCode, CFIndex, CFTypeID};
use string::CFStringRef;
use crate::base::{Boolean, CFAllocatorRef, CFHashCode, CFIndex, CFTypeID};
use crate::string::CFStringRef;

#[repr(C)]
pub struct __CFBag(c_void);
Expand Down
2 changes: 1 addition & 1 deletion core-foundation-sys/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use crate::string::CFStringRef;
use std::cmp::Ordering;
use std::os::raw::{c_int, c_short, c_uchar, c_uint, c_ushort, c_void};
use string::CFStringRef;

pub type Boolean = u8;
pub type mach_port_t = c_uint;
Expand Down
4 changes: 2 additions & 2 deletions core-foundation-sys/src/binary_heap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

use std::os::raw::c_void;

use base::{Boolean, CFAllocatorRef, CFComparisonResult, CFIndex, CFTypeID};
use string::CFStringRef;
use crate::base::{Boolean, CFAllocatorRef, CFComparisonResult, CFIndex, CFTypeID};
use crate::string::CFStringRef;

#[repr(C)]
pub struct __CFBinaryHeap(c_void);
Expand Down
2 changes: 1 addition & 1 deletion core-foundation-sys/src/bit_vector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

use std::os::raw::c_void;

use base::{Boolean, CFAllocatorRef, CFIndex, CFRange, CFTypeID, UInt32, UInt8};
use crate::base::{Boolean, CFAllocatorRef, CFIndex, CFRange, CFTypeID, UInt32, UInt8};

#[repr(C)]
pub struct __CFBitVector(c_void);
Expand Down
14 changes: 7 additions & 7 deletions core-foundation-sys/src/bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@

use std::os::raw::c_void;

use array::CFArrayRef;
use crate::array::CFArrayRef;
#[cfg(target_os = "macos")]
use base::SInt32;
use base::{Boolean, CFAllocatorRef, CFTypeID, CFTypeRef, UInt32};
use dictionary::CFDictionaryRef;
use error::CFErrorRef;
use crate::base::SInt32;
use crate::base::{Boolean, CFAllocatorRef, CFTypeID, CFTypeRef, UInt32};
use crate::dictionary::CFDictionaryRef;
use crate::error::CFErrorRef;
use crate::string::CFStringRef;
use crate::url::CFURLRef;
use std::os::raw::{c_int, c_uint};
use string::CFStringRef;
use url::CFURLRef;

#[repr(C)]
pub struct __CFBundle(c_void);
Expand Down
8 changes: 4 additions & 4 deletions core-foundation-sys/src/calendar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

use std::os::raw::{c_char, c_void};

use base::{Boolean, CFAllocatorRef, CFIndex, CFOptionFlags, CFRange, CFTypeID};
use date::{CFAbsoluteTime, CFTimeInterval};
use locale::{CFCalendarIdentifier, CFLocaleRef};
use timezone::CFTimeZoneRef;
use crate::base::{Boolean, CFAllocatorRef, CFIndex, CFOptionFlags, CFRange, CFTypeID};
use crate::date::{CFAbsoluteTime, CFTimeInterval};
use crate::locale::{CFCalendarIdentifier, CFLocaleRef};
use crate::timezone::CFTimeZoneRef;

#[repr(C)]
pub struct __CFCalendar(c_void);
Expand Down
6 changes: 3 additions & 3 deletions core-foundation-sys/src/characterset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use base::{Boolean, CFAllocatorRef, CFIndex, CFRange, CFTypeID, UTF32Char};
use data::CFDataRef;
use crate::base::{Boolean, CFAllocatorRef, CFIndex, CFRange, CFTypeID, UTF32Char};
use crate::data::CFDataRef;
use crate::string::{CFStringRef, UniChar};
use std::os::raw::c_void;
use string::{CFStringRef, UniChar};

pub type CFCharacterSetPredefinedSet = CFIndex;

Expand Down
2 changes: 1 addition & 1 deletion core-foundation-sys/src/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use base::{CFAllocatorRef, CFIndex, CFOptionFlags, CFRange, CFTypeID};
use crate::base::{CFAllocatorRef, CFIndex, CFOptionFlags, CFRange, CFTypeID};
use std::os::raw::c_void;

#[repr(C)]
Expand Down
2 changes: 1 addition & 1 deletion core-foundation-sys/src/date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

use std::os::raw::c_void;

use base::{CFAllocatorRef, CFComparisonResult, CFTypeID};
use crate::base::{CFAllocatorRef, CFComparisonResult, CFTypeID};

#[repr(C)]
pub struct __CFDate(c_void);
Expand Down
8 changes: 4 additions & 4 deletions core-foundation-sys/src/date_formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

use std::os::raw::c_void;

use base::{Boolean, CFAllocatorRef, CFIndex, CFOptionFlags, CFRange, CFTypeID, CFTypeRef};
use date::{CFAbsoluteTime, CFDateRef};
use locale::CFLocaleRef;
use string::CFStringRef;
use crate::base::{Boolean, CFAllocatorRef, CFIndex, CFOptionFlags, CFRange, CFTypeID, CFTypeRef};
use crate::date::{CFAbsoluteTime, CFDateRef};
use crate::locale::CFLocaleRef;
use crate::string::CFStringRef;

#[repr(C)]
pub struct __CFDateFormatter(c_void);
Expand Down
4 changes: 2 additions & 2 deletions core-foundation-sys/src/dictionary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

use std::os::raw::c_void;

use base::{Boolean, CFAllocatorRef, CFHashCode, CFIndex, CFTypeID};
use string::CFStringRef;
use crate::base::{Boolean, CFAllocatorRef, CFHashCode, CFIndex, CFTypeID};
use crate::string::CFStringRef;

pub type CFDictionaryApplierFunction =
extern "C" fn(key: *const c_void, value: *const c_void, context: *mut c_void);
Expand Down
6 changes: 3 additions & 3 deletions core-foundation-sys/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

use std::os::raw::c_void;

use base::{CFAllocatorRef, CFIndex, CFTypeID};
use dictionary::CFDictionaryRef;
use string::CFStringRef;
use crate::base::{CFAllocatorRef, CFIndex, CFTypeID};
use crate::dictionary::CFDictionaryRef;
use crate::string::CFStringRef;

#[repr(C)]
pub struct __CFError(c_void);
Expand Down
6 changes: 3 additions & 3 deletions core-foundation-sys/src/file_security.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
use std::os::raw::c_void;

#[cfg(feature = "mac_os_10_8_features")]
use base::CFOptionFlags;
use base::{Boolean, CFAllocatorRef, CFTypeID};
use uuid::CFUUIDRef;
use crate::base::CFOptionFlags;
use crate::base::{Boolean, CFAllocatorRef, CFTypeID};
use crate::uuid::CFUUIDRef;

#[repr(C)]
pub struct __CFFileSecurity(c_void);
Expand Down
6 changes: 3 additions & 3 deletions core-foundation-sys/src/filedescriptor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

use std::os::raw::{c_int, c_void};

use base::{Boolean, CFAllocatorRef, CFIndex, CFOptionFlags, CFTypeID};
use runloop::CFRunLoopSourceRef;
use string::CFStringRef;
use crate::base::{Boolean, CFAllocatorRef, CFIndex, CFOptionFlags, CFTypeID};
use crate::runloop::CFRunLoopSourceRef;
use crate::string::CFStringRef;

pub type CFFileDescriptorNativeDescriptor = c_int;

Expand Down
10 changes: 5 additions & 5 deletions core-foundation-sys/src/locale.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use array::CFArrayRef;
use base::{CFAllocatorRef, CFIndex, CFTypeID, CFTypeRef, LangCode, RegionCode};
use dictionary::CFDictionaryRef;
use notification_center::CFNotificationName;
use crate::array::CFArrayRef;
use crate::base::{CFAllocatorRef, CFIndex, CFTypeID, CFTypeRef, LangCode, RegionCode};
use crate::dictionary::CFDictionaryRef;
use crate::notification_center::CFNotificationName;
use crate::string::CFStringRef;
use std::os::raw::c_void;
use string::CFStringRef;

#[repr(C)]
pub struct __CFLocale(c_void);
Expand Down
8 changes: 4 additions & 4 deletions core-foundation-sys/src/mach_port.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use base::{mach_port_t, Boolean};
pub use base::{CFAllocatorRef, CFIndex, CFTypeID};
use runloop::CFRunLoopSourceRef;
use crate::base::{mach_port_t, Boolean};
pub use crate::base::{CFAllocatorRef, CFIndex, CFTypeID};
use crate::runloop::CFRunLoopSourceRef;
use crate::string::CFStringRef;
use std::os::raw::c_void;
use string::CFStringRef;

#[repr(C)]
pub struct __CFMachPort(c_void);
Expand Down
10 changes: 5 additions & 5 deletions core-foundation-sys/src/messageport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@

use std::os::raw::c_void;

use base::{Boolean, CFAllocatorRef, CFIndex, CFTypeID, SInt32};
use data::CFDataRef;
use date::CFTimeInterval;
use runloop::CFRunLoopSourceRef;
use string::CFStringRef;
use crate::base::{Boolean, CFAllocatorRef, CFIndex, CFTypeID, SInt32};
use crate::data::CFDataRef;
use crate::date::CFTimeInterval;
use crate::runloop::CFRunLoopSourceRef;
use crate::string::CFStringRef;

#[repr(C)]
#[derive(Copy, Clone, Debug)]
Expand Down
6 changes: 3 additions & 3 deletions core-foundation-sys/src/notification_center.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

use std::os::raw::c_void;

use base::{Boolean, CFIndex, CFOptionFlags, CFTypeID};
use dictionary::CFDictionaryRef;
use string::CFStringRef;
use crate::base::{Boolean, CFIndex, CFOptionFlags, CFTypeID};
use crate::dictionary::CFDictionaryRef;
use crate::string::CFStringRef;

#[repr(C)]
pub struct __CFNotificationCenter(c_void);
Expand Down
2 changes: 1 addition & 1 deletion core-foundation-sys/src/number.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

use std::os::raw::c_void;

use base::{Boolean, CFAllocatorRef, CFComparisonResult, CFIndex, CFTypeID};
use crate::base::{Boolean, CFAllocatorRef, CFComparisonResult, CFIndex, CFTypeID};

#[repr(C)]
pub struct __CFBoolean(c_void);
Expand Down
8 changes: 4 additions & 4 deletions core-foundation-sys/src/number_formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

use std::os::raw::{c_double, c_void};

use base::{Boolean, CFAllocatorRef, CFIndex, CFOptionFlags, CFRange, CFTypeID, CFTypeRef};
use locale::CFLocaleRef;
use number::{CFNumberRef, CFNumberType};
use string::CFStringRef;
use crate::base::{Boolean, CFAllocatorRef, CFIndex, CFOptionFlags, CFRange, CFTypeID, CFTypeRef};
use crate::locale::CFLocaleRef;
use crate::number::{CFNumberRef, CFNumberType};
use crate::string::CFStringRef;

#[repr(C)]
pub struct __CFNumberFormatter(c_void);
Expand Down
12 changes: 6 additions & 6 deletions core-foundation-sys/src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@

use std::os::raw::c_void;

use array::CFArrayRef;
use base::{Boolean, CFAllocatorRef, CFIndex, CFTypeID};
use bundle::{CFBundleRef, CFPlugInRef};
use string::CFStringRef;
use url::CFURLRef;
use uuid::CFUUIDRef;
use crate::array::CFArrayRef;
use crate::base::{Boolean, CFAllocatorRef, CFIndex, CFTypeID};
use crate::bundle::{CFBundleRef, CFPlugInRef};
use crate::string::CFStringRef;
use crate::url::CFURLRef;
use crate::uuid::CFUUIDRef;

#[repr(C)]
pub struct __CFPlugInInstance(c_void);
Expand Down
Loading