Skip to content

Commit 04bddc0

Browse files
pentamassivbilelmoussaoui
authored andcommitted
Disentangle docsrs and features
1 parent 5fadbea commit 04bddc0

File tree

8 files changed

+46
-47
lines changed

8 files changed

+46
-47
lines changed

cairo/src/pdf.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use std::{
1313
use glib::translate::*;
1414

1515
use crate::{Error, PdfVersion, Surface, SurfaceType};
16-
#[cfg(any(all(feature = "pdf", feature = "v1_16"), docsrs))]
16+
#[cfg(all(feature = "pdf", feature = "v1_16"))]
1717
use crate::{PdfMetadata, PdfOutline};
1818

1919
impl PdfVersion {
@@ -73,7 +73,7 @@ impl PdfSurface {
7373
self.status()
7474
}
7575

76-
#[cfg(any(all(feature = "pdf", feature = "v1_16"), docsrs))]
76+
#[cfg(all(feature = "pdf", feature = "v1_16"))]
7777
#[doc(alias = "cairo_pdf_surface_set_metadata")]
7878
pub fn set_metadata(&self, metadata: PdfMetadata, value: &str) -> Result<(), Error> {
7979
let value = CString::new(value).unwrap();
@@ -87,7 +87,7 @@ impl PdfSurface {
8787
self.status()
8888
}
8989

90-
#[cfg(any(all(feature = "pdf", feature = "v1_18"), docsrs))]
90+
#[cfg(all(feature = "pdf", feature = "v1_18"))]
9191
#[doc(alias = "cairo_pdf_surface_set_custom_metadata")]
9292
pub fn set_custom_metadata(&self, name: &str, value: &str) -> Result<(), Error> {
9393
let name = CString::new(name).unwrap();
@@ -102,7 +102,7 @@ impl PdfSurface {
102102
self.status()
103103
}
104104

105-
#[cfg(any(all(feature = "pdf", feature = "v1_16"), docsrs))]
105+
#[cfg(all(feature = "pdf", feature = "v1_16"))]
106106
#[doc(alias = "cairo_pdf_surface_set_page_label")]
107107
pub fn set_page_label(&self, label: &str) -> Result<(), Error> {
108108
let label = CString::new(label).unwrap();
@@ -112,7 +112,7 @@ impl PdfSurface {
112112
self.status()
113113
}
114114

115-
#[cfg(any(all(feature = "pdf", feature = "v1_16"), docsrs))]
115+
#[cfg(all(feature = "pdf", feature = "v1_16"))]
116116
#[doc(alias = "cairo_pdf_surface_set_thumbnail_size")]
117117
pub fn set_thumbnail_size(&self, width: i32, height: i32) -> Result<(), Error> {
118118
unsafe {
@@ -125,7 +125,7 @@ impl PdfSurface {
125125
self.status()
126126
}
127127

128-
#[cfg(any(all(feature = "pdf", feature = "v1_16"), docsrs))]
128+
#[cfg(all(feature = "pdf", feature = "v1_16"))]
129129
#[doc(alias = "cairo_pdf_surface_add_outline")]
130130
pub fn add_outline(
131131
&self,

cairo/src/svg.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use std::{
1414
#[cfg(feature = "use_glib")]
1515
use glib::translate::*;
1616

17-
#[cfg(any(all(feature = "svg", feature = "v1_16"), docsrs))]
17+
#[cfg(all(feature = "svg", feature = "v1_16"))]
1818
use crate::SvgUnit;
1919
use crate::{Error, Surface, SurfaceType, SvgVersion};
2020

@@ -95,15 +95,15 @@ impl SvgSurface {
9595
}
9696
}
9797

98-
#[cfg(any(all(feature = "svg", feature = "v1_16"), docsrs))]
98+
#[cfg(all(feature = "svg", feature = "v1_16"))]
9999
#[doc(alias = "cairo_svg_surface_set_document_unit")]
100100
pub fn set_document_unit(&mut self, unit: SvgUnit) {
101101
unsafe {
102102
ffi::cairo_svg_surface_set_document_unit(self.0.to_raw_none(), unit.into());
103103
}
104104
}
105105

106-
#[cfg(any(all(feature = "svg", feature = "v1_16"), docsrs))]
106+
#[cfg(all(feature = "svg", feature = "v1_16"))]
107107
#[doc(alias = "cairo_svg_surface_get_document_unit")]
108108
#[doc(alias = "get_document_unit")]
109109
pub fn document_unit(&self) -> SvgUnit {

gio/src/lib.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ mod dbus_node_info;
3434
#[cfg(feature = "v2_72")]
3535
#[cfg_attr(docsrs, doc(cfg(feature = "v2_72")))]
3636
mod debug_controller_dbus;
37-
#[cfg(any(all(not(windows), not(target_os = "macos")), docsrs))]
37+
#[cfg(all(not(windows), not(target_os = "macos")))]
3838
mod desktop_app_info;
3939
mod error;
4040
mod file;
@@ -43,9 +43,9 @@ pub use crate::file_attribute_info::FileAttributeInfo;
4343
mod file_attribute_info_list;
4444
mod file_attribute_matcher;
4545
pub use crate::file_attribute_matcher::FileAttributematcherIter;
46-
#[cfg(any(unix, docsrs))]
46+
#[cfg(unix)]
4747
mod file_descriptor_based;
48-
#[cfg(any(unix, docsrs))]
48+
#[cfg(unix)]
4949
pub use file_descriptor_based::FileDescriptorBased;
5050
mod file_enumerator;
5151
pub use crate::file_enumerator::FileEnumeratorStream;
@@ -84,19 +84,19 @@ pub use socket_msg_flags::SocketMsgFlags;
8484
mod subprocess;
8585
mod subprocess_launcher;
8686
mod threaded_socket_service;
87-
#[cfg(any(unix, docsrs))]
87+
#[cfg(unix)]
8888
mod unix_fd_list;
89-
#[cfg(any(unix, docsrs))]
89+
#[cfg(unix)]
9090
mod unix_fd_message;
91-
#[cfg(any(unix, docsrs))]
91+
#[cfg(unix)]
9292
mod unix_input_stream;
93-
#[cfg(any(unix, docsrs))]
93+
#[cfg(unix)]
9494
mod unix_mount_entry;
95-
#[cfg(any(unix, docsrs))]
95+
#[cfg(unix)]
9696
mod unix_mount_point;
97-
#[cfg(any(unix, docsrs))]
97+
#[cfg(unix)]
9898
mod unix_output_stream;
99-
#[cfg(any(unix, docsrs))]
99+
#[cfg(unix)]
100100
mod unix_socket_address;
101101

102102
#[cfg(test)]

gio/src/socket.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ impl Socket {
4646
}
4747
}
4848

49-
#[cfg(any(unix, docsrs))]
49+
#[cfg(unix)]
5050
#[cfg_attr(docsrs, doc(cfg(unix)))]
5151
impl AsRawFd for Socket {
5252
fn as_raw_fd(&self) -> RawFd {
5353
unsafe { ffi::g_socket_get_fd(self.to_glib_none().0) as _ }
5454
}
5555
}
5656

57-
#[cfg(any(windows, docsrs))]
57+
#[cfg(windows)]
5858
#[cfg_attr(docsrs, doc(cfg(windows)))]
5959
impl AsRawSocket for Socket {
6060
fn as_raw_socket(&self) -> RawSocket {

gio/src/subprocess_launcher.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
#[cfg(any(unix, all(docsrs, unix)))]
44
use std::os::unix::io::IntoRawFd;
55

6-
#[cfg(any(unix, docsrs))]
7-
#[cfg(any(unix, docsrs))]
6+
#[cfg(unix)]
87
use glib::translate::*;
98

109
use crate::SubprocessLauncher;
@@ -17,7 +16,7 @@ pub trait IntoRawFd: Sized {
1716
}
1817

1918
impl SubprocessLauncher {
20-
#[cfg(any(unix, docsrs))]
19+
#[cfg(unix)]
2120
#[cfg_attr(docsrs, doc(cfg(unix)))]
2221
#[doc(alias = "g_subprocess_launcher_take_fd")]
2322
pub fn take_fd(&self, source_fd: impl IntoRawFd, target_fd: impl IntoRawFd) {
@@ -30,7 +29,7 @@ impl SubprocessLauncher {
3029
}
3130
}
3231

33-
#[cfg(any(unix, docsrs))]
32+
#[cfg(unix)]
3433
#[cfg_attr(docsrs, doc(cfg(unix)))]
3534
#[doc(alias = "g_subprocess_launcher_take_stderr_fd")]
3635
pub fn take_stderr_fd(&self, fd: impl IntoRawFd) {
@@ -39,7 +38,7 @@ impl SubprocessLauncher {
3938
}
4039
}
4140

42-
#[cfg(any(unix, docsrs))]
41+
#[cfg(unix)]
4342
#[cfg_attr(docsrs, doc(cfg(unix)))]
4443
#[doc(alias = "g_subprocess_launcher_take_stdin_fd")]
4544
pub fn take_stdin_fd(&self, fd: impl IntoRawFd) {
@@ -48,7 +47,7 @@ impl SubprocessLauncher {
4847
}
4948
}
5049

51-
#[cfg(any(unix, docsrs))]
50+
#[cfg(unix)]
5251
#[cfg_attr(docsrs, doc(cfg(unix)))]
5352
#[doc(alias = "g_subprocess_launcher_take_stdout_fd")]
5453
pub fn take_stdout_fd(&self, fd: impl IntoRawFd) {

gio/src/unix_mount_point.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use glib::translate::*;
77
use crate::UnixMountPoint;
88

99
impl UnixMountPoint {
10-
#[cfg(any(unix, docsrs))]
10+
#[cfg(unix)]
1111
#[doc(alias = "g_unix_mount_points_get")]
1212
#[doc(alias = "get_mount_points")]
1313
pub fn mount_points() -> (Vec<UnixMountPoint>, u64) {

glib/src/source.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use ffi::{self, gboolean, gpointer};
88
#[cfg(all(not(unix), docsrs))]
99
use libc::c_int as RawFd;
1010

11-
#[cfg(any(unix, docsrs))]
11+
#[cfg(unix)]
1212
use crate::IOCondition;
1313
use crate::{thread_guard::ThreadGuard, translate::*, ControlFlow, MainContext, Source};
1414

@@ -151,7 +151,7 @@ fn into_raw_child_watch_local<F: FnMut(Pid, i32) + 'static>(func: F) -> gpointer
151151
Box::into_raw(func) as gpointer
152152
}
153153

154-
#[cfg(any(unix, docsrs))]
154+
#[cfg(unix)]
155155
#[cfg_attr(docsrs, doc(cfg(unix)))]
156156
unsafe extern "C" fn trampoline_unix_fd<
157157
F: FnMut(RawFd, IOCondition) -> ControlFlow + Send + 'static,
@@ -164,7 +164,7 @@ unsafe extern "C" fn trampoline_unix_fd<
164164
(*func.borrow_mut())(fd, from_glib(condition)).into_glib()
165165
}
166166

167-
#[cfg(any(unix, docsrs))]
167+
#[cfg(unix)]
168168
#[cfg_attr(docsrs, doc(cfg(unix)))]
169169
unsafe extern "C" fn trampoline_unix_fd_local<
170170
F: FnMut(RawFd, IOCondition) -> ControlFlow + 'static,
@@ -177,7 +177,7 @@ unsafe extern "C" fn trampoline_unix_fd_local<
177177
(*func.get_ref().borrow_mut())(fd, from_glib(condition)).into_glib()
178178
}
179179

180-
#[cfg(any(unix, docsrs))]
180+
#[cfg(unix)]
181181
#[cfg_attr(docsrs, doc(cfg(unix)))]
182182
unsafe extern "C" fn destroy_closure_unix_fd<
183183
F: FnMut(RawFd, IOCondition) -> ControlFlow + Send + 'static,
@@ -187,7 +187,7 @@ unsafe extern "C" fn destroy_closure_unix_fd<
187187
let _ = Box::<RefCell<F>>::from_raw(ptr as *mut _);
188188
}
189189

190-
#[cfg(any(unix, docsrs))]
190+
#[cfg(unix)]
191191
#[cfg_attr(docsrs, doc(cfg(unix)))]
192192
unsafe extern "C" fn destroy_closure_unix_fd_local<
193193
F: FnMut(RawFd, IOCondition) -> ControlFlow + 'static,
@@ -197,7 +197,7 @@ unsafe extern "C" fn destroy_closure_unix_fd_local<
197197
let _ = Box::<ThreadGuard<RefCell<F>>>::from_raw(ptr as *mut _);
198198
}
199199

200-
#[cfg(any(unix, docsrs))]
200+
#[cfg(unix)]
201201
#[cfg_attr(docsrs, doc(cfg(unix)))]
202202
fn into_raw_unix_fd<F: FnMut(RawFd, IOCondition) -> ControlFlow + Send + 'static>(
203203
func: F,
@@ -206,7 +206,7 @@ fn into_raw_unix_fd<F: FnMut(RawFd, IOCondition) -> ControlFlow + Send + 'static
206206
Box::into_raw(func) as gpointer
207207
}
208208

209-
#[cfg(any(unix, docsrs))]
209+
#[cfg(unix)]
210210
#[cfg_attr(docsrs, doc(cfg(unix)))]
211211
fn into_raw_unix_fd_local<F: FnMut(RawFd, IOCondition) -> ControlFlow + 'static>(
212212
func: F,
@@ -630,7 +630,7 @@ where
630630
}
631631
}
632632

633-
#[cfg(any(unix, docsrs))]
633+
#[cfg(unix)]
634634
#[cfg_attr(docsrs, doc(cfg(unix)))]
635635
// rustdoc-stripper-ignore-next
636636
/// Adds a closure to be called by the default main loop whenever a UNIX signal is raised.
@@ -656,7 +656,7 @@ where
656656
}
657657
}
658658

659-
#[cfg(any(unix, docsrs))]
659+
#[cfg(unix)]
660660
#[cfg_attr(docsrs, doc(cfg(unix)))]
661661
// rustdoc-stripper-ignore-next
662662
/// Adds a closure to be called by the default main loop whenever a UNIX signal is raised.
@@ -677,7 +677,7 @@ where
677677
unix_signal_add(signum, fnmut_callback_wrapper(func))
678678
}
679679

680-
#[cfg(any(unix, docsrs))]
680+
#[cfg(unix)]
681681
#[cfg_attr(docsrs, doc(cfg(unix)))]
682682
// rustdoc-stripper-ignore-next
683683
/// Adds a closure to be called by the default main loop whenever a UNIX signal is raised.
@@ -713,7 +713,7 @@ where
713713
}
714714
}
715715

716-
#[cfg(any(unix, docsrs))]
716+
#[cfg(unix)]
717717
#[cfg_attr(docsrs, doc(cfg(unix)))]
718718
// rustdoc-stripper-ignore-next
719719
/// Adds a closure to be called by the default main loop whenever a UNIX signal is raised.
@@ -740,7 +740,7 @@ where
740740
unix_signal_add_local(signum, fnmut_callback_wrapper_local(func))
741741
}
742742

743-
#[cfg(any(unix, docsrs))]
743+
#[cfg(unix)]
744744
#[cfg_attr(docsrs, doc(cfg(unix)))]
745745
// rustdoc-stripper-ignore-next
746746
/// Adds a closure to be called by the main loop the returned `Source` is attached to whenever a
@@ -768,7 +768,7 @@ where
768768
}
769769
}
770770

771-
#[cfg(any(unix, docsrs))]
771+
#[cfg(unix)]
772772
#[cfg_attr(docsrs, doc(cfg(unix)))]
773773
// rustdoc-stripper-ignore-next
774774
/// Adds a closure to be called by the main loop the returned `Source` is attached to whenever a
@@ -988,7 +988,7 @@ where
988988
}
989989
}
990990

991-
#[cfg(any(unix, docsrs))]
991+
#[cfg(unix)]
992992
#[cfg_attr(docsrs, doc(cfg(unix)))]
993993
// rustdoc-stripper-ignore-next
994994
/// Adds a closure to be called by the main loop the returned `Source` is attached to whenever a
@@ -1024,7 +1024,7 @@ where
10241024
}
10251025
}
10261026

1027-
#[cfg(any(unix, docsrs))]
1027+
#[cfg(unix)]
10281028
#[cfg_attr(docsrs, doc(cfg(unix)))]
10291029
// rustdoc-stripper-ignore-next
10301030
/// Adds a closure to be called by the main loop the returned `Source` is attached to whenever a

glib/src/source_futures.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ pub fn child_watch_future_with_priority(
194194
}))
195195
}
196196

197-
#[cfg(any(unix, docsrs))]
197+
#[cfg(unix)]
198198
#[cfg_attr(docsrs, doc(cfg(unix)))]
199199
// rustdoc-stripper-ignore-next
200200
/// Create a `Future` that will resolve once the given UNIX signal is raised
@@ -204,7 +204,7 @@ pub fn unix_signal_future(signum: i32) -> Pin<Box<dyn Future<Output = ()> + Send
204204
unix_signal_future_with_priority(crate::Priority::default(), signum)
205205
}
206206

207-
#[cfg(any(unix, docsrs))]
207+
#[cfg(unix)]
208208
#[cfg_attr(docsrs, doc(cfg(unix)))]
209209
// rustdoc-stripper-ignore-next
210210
/// Create a `Future` that will resolve once the given UNIX signal is raised
@@ -380,7 +380,7 @@ pub fn interval_stream_seconds_with_priority(
380380
}))
381381
}
382382

383-
#[cfg(any(unix, docsrs))]
383+
#[cfg(unix)]
384384
#[cfg_attr(docsrs, doc(cfg(unix)))]
385385
// rustdoc-stripper-ignore-next
386386
/// Create a `Stream` that will provide a value whenever the given UNIX signal is raised
@@ -390,7 +390,7 @@ pub fn unix_signal_stream(signum: i32) -> Pin<Box<dyn Stream<Item = ()> + Send +
390390
unix_signal_stream_with_priority(crate::Priority::default(), signum)
391391
}
392392

393-
#[cfg(any(unix, docsrs))]
393+
#[cfg(unix)]
394394
#[cfg_attr(docsrs, doc(cfg(unix)))]
395395
// rustdoc-stripper-ignore-next
396396
/// Create a `Stream` that will provide a value whenever the given UNIX signal is raised

0 commit comments

Comments
 (0)