@@ -742,7 +742,8 @@ impl SpacectlRange {
742
742
///
743
743
/// # Example
744
744
///
745
- /// ```
745
+ // no_run because it fails to link until FreeBSD 14.0
746
+ /// ```no_run
746
747
/// # use std::io::Write;
747
748
/// # use std::os::unix::fs::FileExt;
748
749
/// # use std::os::unix::io::AsRawFd;
@@ -753,12 +754,7 @@ impl SpacectlRange {
753
754
/// f.write_all(INITIAL).unwrap();
754
755
/// let mut range = SpacectlRange(3, 6);
755
756
/// while (!range.is_empty()) {
756
- /// let r = fspacectl(f.as_raw_fd(), range);
757
- /// # if r == Err(nix::Error::ENOSYS) {
758
- /// # // not supported until FreeBSD 14.0
759
- /// # return;
760
- /// # }
761
- /// range = r.unwrap();
757
+ /// range = fspacectl(f.as_raw_fd(), range).unwrap();
762
758
/// }
763
759
/// let mut buf = vec![0; INITIAL.len()];
764
760
/// f.read_exact_at(&mut buf, 0).unwrap();
@@ -792,7 +788,8 @@ pub fn fspacectl(fd: RawFd, range: SpacectlRange) -> Result<SpacectlRange> {
792
788
///
793
789
/// # Example
794
790
///
795
- /// ```
791
+ // no_run because it fails to link until FreeBSD 14.0
792
+ /// ```no_run
796
793
/// # use std::io::Write;
797
794
/// # use std::os::unix::fs::FileExt;
798
795
/// # use std::os::unix::io::AsRawFd;
@@ -801,12 +798,7 @@ pub fn fspacectl(fd: RawFd, range: SpacectlRange) -> Result<SpacectlRange> {
801
798
/// const INITIAL: &[u8] = b"0123456789abcdef";
802
799
/// let mut f = tempfile().unwrap();
803
800
/// f.write_all(INITIAL).unwrap();
804
- /// let r = fspacectl_all(f.as_raw_fd(), 3, 6);
805
- /// # if r == Err(nix::Error::ENOSYS) {
806
- /// # // not supported until FreeBSD 14.0
807
- /// # return;
808
- /// # }
809
- /// r.unwrap();
801
+ /// fspacectl_all(f.as_raw_fd(), 3, 6).unwrap();
810
802
/// let mut buf = vec![0; INITIAL.len()];
811
803
/// f.read_exact_at(&mut buf, 0).unwrap();
812
804
/// assert_eq!(buf, b"012\0\0\0\0\0\09abcdef");
0 commit comments