Description: avoid not-in-Debian crate profiling
Author: Jonas Smedegaard <dr@jones.dk>
Forwarded: not-needed
Last-Update: 2024-03-23
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -35,7 +35,6 @@
 iter_fixed = "0.4"
 log = "0.4"
 nom = "7.1"
-profiling = "1.0"
 regex = "1.11"
 thiserror = "2.0"
 
--- a/src/vobsub/idx.rs
+++ b/src/vobsub/idx.rs
@@ -77,7 +77,6 @@
     ///
     /// # Errors
     /// Will return VobSubError::Io if failed to open of read `.idx` or ``.sub`` file.
-    #[profiling::function]
     pub fn open<P: AsRef<Path>>(path: P) -> Result<Self, VobSubError> {
         let path = path.as_ref();
         let mkerr_idx = |source| VobSubError::Io {
@@ -98,7 +97,6 @@
     ///
     /// # Panics
     /// Panic if the Regex creation failed
-    #[profiling::function]
     pub fn read_index<T, Err>(mut input: BufReader<T>, mkerr: &Err) -> Result<Self, VobSubError>
     where
         T: std::io::Read,
--- a/src/vobsub/img.rs
+++ b/src/vobsub/img.rs
@@ -185,7 +185,6 @@
 /// Decompress a run-length encoded image, and return a vector in row-major
 /// order, starting at the upper-left and scanning right and down, with one
 /// byte for each 2-bit value.
-#[profiling::function]
 pub fn decompress(size: Size, data: &VobSubRleImageData) -> Result<Vec<u8>, Error> {
     trace!(
         "decompressing image {:?}, max: [0x{:x}, 0x{:x}]",
@@ -340,7 +339,6 @@
 {
     type Pixel = P;
 
-    #[profiling::function]
     fn to_image(&self) -> ImageBuffer<P, Vec<u8>>
     where
         P: Pixel<Subpixel = u8>,
@@ -394,7 +392,6 @@
 }
 
 impl ToOcrImage for VobSubOcrImage<'_> {
-    #[profiling::function]
     fn image(&self, opt: &ToOcrImageOpt) -> image::GrayImage {
         let width = self.indexed_img.width();
         let height = self.indexed_img.height();
--- a/src/vobsub/sub.rs
+++ b/src/vobsub/sub.rs
@@ -469,7 +469,6 @@
 
     // Read all pes_packets needed to parse a subtitle.
     fn next_sub_packet(&mut self) -> Option<Result<(f64, Vec<u8>), VobSubError>> {
-        profiling::scope!("VobsubParser next_sub_packet");
 
         // Get the `PES` packet containing the first chunk of our subtitle.
         let first: ps::PesPacket = try_iter!(self.pes_packets.next());
@@ -529,7 +528,6 @@
     type Item = Result<(TimeSpan, VobSubIndexedImage), VobSubError>;
 
     fn next(&mut self) -> Option<Self::Item> {
-        profiling::scope!("VobsubParser next");
 
         let (base_time, sub_packet) = try_iter!(self.next_sub_packet());
         let subtitle = subtitle::<(TimeSpan, VobSubIndexedImage), _>(&sub_packet, base_time);
--- a/src/image/utils.rs
+++ b/src/image/utils.rs
@@ -37,7 +37,6 @@
 /// # Errors
 /// Will return `DumpError::Folder` if the output folder creation failed.
 /// Will return `DumpError::DumpImage` if the dump of one image failed.
-#[profiling::function]
 pub fn dump_images<'a, Iter, Img, P, Container>(
     path: &str,
     images: Iter,
@@ -75,7 +74,6 @@
 }
 
 /// Dump one image
-#[profiling::function]
 fn dump_image<P, Pix, Container>(
     filename: P,
     image: &image::ImageBuffer<Pix, Container>, // image::Luma<u8>, Vec<u8>
--- a/src/pgs/pgs_image.rs
+++ b/src/pgs/pgs_image.rs
@@ -113,7 +113,6 @@
 {
     type Pixel = P;
 
-    #[profiling::function]
     fn to_image(&self) -> ImageBuffer<P, Vec<u8>>
     where
         P: Pixel<Subpixel = u8>,
@@ -138,7 +137,6 @@
 where
     C: Fn(LumaA<u8>) -> Luma<u8>,
 {
-    #[profiling::function]
     fn image(&self, opt: &ToOcrImageOpt) -> image::GrayImage {
         let width = self.rle_image.width();
         let height = self.rle_image.height();
--- a/src/pgs/sup.rs
+++ b/src/pgs/sup.rs
@@ -31,7 +31,6 @@
     }
 
     /// Create a parser for a `*.sup` file from the path of the file.
-    #[profiling::function]
     pub fn from_file<P>(path: P) -> Result<SupParser<BufReader<File>, Decoder>, PgsError>
     where
         P: AsRef<Path>,
